Hey! Im desperately in need of your help!!! My data set is string daily (without the weekends) I've tried formatting the data using the command: generate time=date(date, "MDY") but it keeps responding with "missing values generated". Please help me i've tried everything and nothing works. My data is 01/01/1991 (MDY) and its called date but i dont know why it isnt working
Hi, great video, very clear. However I do have a question regarding the time series of multiple companies and using at the same time their data (stock return mixed with the market to book value), how would that apply?
Hi, would this method of detrending data work for multiple linear regression? I detrended all of my variables but my R-squared is equal to 1, and when I run the regression without detrending the variables the R-squared is less than 1.
Thanks for the video, could you please help me with these questions if possible? I want to perform a multiple regression analysis, using time series data on the effect of foreign direct investment (FDI) on GDP. (I will also include a few other independent variables such as school years). Should i include the time trend variable 't' when performing the regression? I haven't seen other papers using similar models include it in their Stata results. Also, when testing for stationarity, is it should i include time trend? E.G: dfuller GDP_growth if period >= 1991, trend
Including some kind of trend (linear, quadratic, etc.) is common, but it's entirely up to you whether you think it is appropriate. I haven't done the Dickey-Fuller test in a long time, so I'm not sure about that one.
@@sebastianwaiecon Thank you very much for your response. Could i also ask, if I were to include the time trend, would you normally be expected to analyse the t variable, e.g coefficient, p value, etc. when discussing the results of the regression?
what if in year we have repeats years for different countries for example country usa 2010 usa 2011 usa 2012 usa 2013 china 2010 china 2011 china 2012 china 2013 for example...how we treat this?
@@sebastianwaiecon thanks i just build up the panel data but now, iam strugguling with the graphs i dont know how to include countrid with year and population in a line graphs...thanks for answer.
You are awesome! I spent the past two weeks trying to do all of this but I couldn't find anything until your video. Could you help explain how to do quadratic detrending if the only data I have is real GDP?
hello, thanks for the video! would having data for multiple countries for different years (that is, data fro 2016 for 10 different countries and then the same variable for those same countries for 2015 etc) count as time series?
@@sebastianwaiecon i do exactly the same things he does. my dates are from 1982 to 1993. when i try to use command xtreg State Date, yearly it gives that error. i am trying to find out what affects bank profitability in USA. is that command even correct? maybe correct version is xtreg BankNames Date, yearly. which one is correct?
By itself, this is not indicative of any problems with the model -- you simply found no relationship between variables. That doesn't mean there are not problems, though. You could still have endogeneity that, once taken care of, could reveal relationships you didn't see previously.
Not sure what you mean by that, but if you have multiple observations for each time period, then you don't have a time series anymore. In that case, see my video on fixed effects.
@@sebastianwaiecon Is it possible to decompose time series data into the trend, seasonal and cyclic components using STATA. If so, do you mind sharing the code?
That is correct, because then your data is not a time series. I recommend my video on panel data and fixed effects for that: th-cam.com/video/H95BHswbT3w/w-d-xo.html
Stata is not a good program for time series. First having a variable t can be helpful, but first you need date variable. This is in all modern statistical programs constructed by the program automatically unless you have daily data. How do you construct a date time series in Stata? The answer is that if you have to look for it use another program. Second you should never de-trend you data with a linear trend. This will lead to what is known as spurious de-trending. Economic data almost never follows deterministic trends. This video tells you have to construct t but not what do to tell Stata about what type of time series data you have and impose correct dates for your observations.
Hi Robert, you said economic data never normally follows deterministic trends. I want to perform a multiple regression analysis on the impact of FDI on GDP, whilst also controlling for education and infrastructure, do you think it's worthwhile to include a time trend variable? When i do use the time trend variable, it makes the adjusted R-squared slightly higher.
Awesome 👏! Two minutes in and my problem was solved
This is a super tutorial. Thanks so much, sir. God bless you
Did u run the Linear detrending and First difference together
Good job for sure. Very helpful
Quite informative
what if you have many samples in your data. each sample has a year intervel. person A is from 2009 to 2015, person B is from 2009 to 2018, ...
Perfect recap for my final! Thx!
I love you, my friend, Im Peruvian, Thx!!!!!!!
Thank you for your wonderful video. But how can we output the outcome of the regression to Word or Excel?
See my video on tables with esttab.
Thanks a lot for your help!!
such a great video! Thank you!
Great
Hey! Im desperately in need of your help!!! My data set is string daily (without the weekends)
I've tried formatting the data using the command: generate time=date(date, "MDY") but it keeps responding with "missing values generated".
Please help me i've tried everything and nothing works. My data is 01/01/1991 (MDY) and its called date but i dont know why it isnt working
You might find this article helpful: stats.idre.ucla.edu/stata/modules/using-dates-in-stata/
Hi, great video, very clear. However I do have a question regarding the time series of multiple companies and using at the same time their data (stock return mixed with the market to book value), how would that apply?
If you have multiple companies over time, you have panel data, not time series. You might be interested in my video on fixed effects models.
@@sebastianwaiecon Hi thank you for your answer, even if it is an analysis of Euro600 (the 600 companies not the index) over 2 years?
Hi, would this method of detrending data work for multiple linear regression? I detrended all of my variables but my R-squared is equal to 1, and when I run the regression without detrending the variables the R-squared is less than 1.
You can detrend with multiple regression as long as you detrend every variable.
Thank you man, you saved me
Thanks for the video, could you please help me with these questions if possible? I want to perform a multiple regression analysis, using time series data on the effect of foreign direct investment (FDI) on GDP. (I will also include a few other independent variables such as school years). Should i include the time trend variable 't' when performing the regression? I haven't seen other papers using similar models include it in their Stata results.
Also, when testing for stationarity, is it should i include time trend? E.G: dfuller GDP_growth if period >= 1991, trend
Including some kind of trend (linear, quadratic, etc.) is common, but it's entirely up to you whether you think it is appropriate. I haven't done the Dickey-Fuller test in a long time, so I'm not sure about that one.
@@sebastianwaiecon Thank you very much for your response.
Could i also ask, if I were to include the time trend, would you normally be expected to analyse the t variable, e.g coefficient, p value, etc. when discussing the results of the regression?
It's usually worth mentioning, but you do have to remember you haven't actually explained why the trend is happening, just that it did happen.
what if in year we have repeats years for different countries for example country usa 2010 usa 2011 usa 2012 usa 2013 china 2010 china 2011 china 2012 china 2013 for example...how we treat this?
In that case, you have panel data and not time series. You might want to look at some of my other videos on panel data and fixed effects.
@@sebastianwaiecon thanks i just build up the panel data but now, iam strugguling with the graphs i dont know how to include countrid with year and population in a line graphs...thanks for answer.
@@ChristianDG21 You might find this helpful: www.stata.com/support/faqs/graphics/gph/stata-graphs/
@@sebastianwaiecon thanks a lot!
You are awesome! I spent the past two weeks trying to do all of this but I couldn't find anything until your video.
Could you help explain how to do quadratic detrending if the only data I have is real GDP?
Add a t^2 term to the regression of GDP on t, then generate residuals.
hello, thanks for the video! would having data for multiple countries for different years (that is, data fro 2016 for 10 different countries and then the same variable for those same countries for 2015 etc) count as time series?
Time series only has one entity over time. When you have multiple then you have panel data.
hi i am trying to use panel data set but it gives error saying "repeated time values". how can i figure it out?
You can't use time series commands for a panel. See this video: th-cam.com/video/H95BHswbT3w/w-d-xo.html&ab_channel=SebastianWaiEcon
@@sebastianwaiecon i do exactly the same things he does. my dates are from 1982 to 1993. when i try to use command xtreg State Date, yearly it gives that error. i am trying to find out what affects bank profitability in USA. is that command even correct? maybe correct version is xtreg BankNames Date, yearly. which one is correct?
If all my explanatory variables are not significant initially, what do I have to do ?
By itself, this is not indicative of any problems with the model -- you simply found no relationship between variables. That doesn't mean there are not problems, though. You could still have endogeneity that, once taken care of, could reveal relationships you didn't see previously.
fantastic! thank you very much
Hey! Thanks for this amazing video! But how can I split the data in different clusters, for example in 2 different groups? Thank you.
Not sure what you mean by that, but if you have multiple observations for each time period, then you don't have a time series anymore. In that case, see my video on fixed effects.
@@sebastianwaiecon Is it possible to decompose time series data into the trend, seasonal and cyclic components using STATA. If so, do you mind sharing the code?
its so very important for me
this does not work if you have multiple variables with the same year
That is correct, because then your data is not a time series. I recommend my video on panel data and fixed effects for that: th-cam.com/video/H95BHswbT3w/w-d-xo.html
Thank you!!!
can you teach about ARDL
You can implement AR and DL with techniques from this video. For AR, take lags of Y. For DL, take lags of X.
I would like
Stata is not a good program for time series. First having a variable t can be helpful, but first you need date variable. This is in all modern statistical programs constructed by the program automatically unless you have daily data. How do you construct a date time series in Stata? The answer is that if you have to look for it use another program. Second you should never de-trend you data with a linear trend. This will lead to what is known as spurious de-trending. Economic data almost never follows deterministic trends. This video tells you have to construct t but not what do to tell Stata about what type of time series data you have and impose correct dates for your observations.
Hi Robert, you said economic data never normally follows deterministic trends. I want to perform a multiple regression analysis on the impact of FDI on GDP, whilst also controlling for education and infrastructure, do you think it's worthwhile to include a time trend variable?
When i do use the time trend variable, it makes the adjusted R-squared slightly higher.
teacher, please give me your data