I don't have much experience in econometrics. I want to do a regression on R to find the determinants of car prices in Brazil. For this, I used as a dependent variable the prices of cars between the years 2009 and 2013 and as independent variables: Tax on industrialized products, Real dollar, interest rate. I would like to know the step by step to do the regression correctly, knowing that it is a non-stationary series.
Thanks and sorry for any english mistakes!
Hello @gabrielfos and welcome to RStudio Community
What you are asking is fairly simple to do in R; however, whenever you ask a data-related question, you should consider providing a reproducible example. I encourage you to read this to learn more about it:
It would definitely help if you could send us a data sample that we could use to help you. You could upload it somewhere and provide a download link?
Finally, when it comes to time series, you cannot run a simple regression with nonstationary series. If you do, the results will be spurious, which means that they will not be reliable for inference. So, the first thing to do is to difference your data in order to make it stationary before running the regression. I can show you how if you provide some data.
Cheers.
Thanks for your answer! These are my data.
first, I did this manipulation:
IPI_HiluxCDxts = xts(IPI_HiluxCD[,-1], order.by = IPI_HiluxCD$month_year)
So i did it:
reg1 = lm(diff(log(IPI_HiluxCDxts$real_price)) ~ diff(IPI_HiluxCDxts$IPI) + diff(IPI_HiluxCDxts$real_dollar) + diff(IPI_HiluxCDxts$interest_rate))
summary(reg1)
Is the way I did it correct?
It looks correct overall; however, is there any reason why you did not log
the other variables besides the dependent variable?
There is no reason. I just thought it should be like this. I will test using the log in the other variables.
Yes, I recommend you do so. Logging all variables would mean that they are scaled the same way, which will make the interpretation of your results easier.
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.
If you have a query related to it or one of the replies, start a new topic and refer back with a link.