Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Time Trend Variable in Regression

    Hello all
    I am reading a paper where the author has run a regression against the time trend. After that, he used the residual of the regression as the dependent variable of the original regression.
    I have a few questions.

    1. Are this method and using time as an independent variable the same?


    2. We use c.time to control for time variations. Can we use i.t instead of c.t? (I think this question is foolish to ask)

    Thanks and Regards

  • #2
    Play around with this.

    HTML Code:
      	 		 			http://www.stata-press.com/data/r13/qsales.dta
    Code:
    use qsales, clear
    tsset t
    
    reg csales t
    predict yfit, resid
    reg isales t
    predict xfit, resid
    
    reg csales isales
    reg yfit xfit
    reg yfit isales
    reg csales isales t
    reg d.csales d.isales

    Comment


    • #3
      Some discussion here.

      HTML Code:
      https://stats.stackexchange.com/questions/540674/is-detrending-a-variable-equivalent-to-including-a-time-trend-in-the-regression

      Comment


      • #4
        This practice looks dangerous unless there is a trend that is really well captured by the first regression. It could make sense to see a trend as obvious, uninteresting, or a nuisance, but you need to match it carefully.

        Comment


        • #5
          Thanks, George
          Kind Regards

          Comment


          • #6
            Thanks, Nick
            Kind Regards

            Comment


            • #7
              As George's code will show, if you detrend all of the x variables using a linear trend (as well as y), its the same as simply adding the trend to the regression. But if the author only detrended y then its a bit fishy. That's not the important step. It's actually removing the trend from the x. Generally, if you want to remove a trend, add it as a regressor (or regressors if it's more complicated than linear).

              Comment


              • #8
                Ok Jeff

                Thanks and Regards

                Comment


                • #9
                  You can fit a regression

                  Yi = a + b*Xi + c*Ti + Ei, where a,b,c are the estimated parameters and Ei is the residual.

                  The Frisch-Waugh-Lowell theorem says that you will obtain the same estimated parameters and the same residuals Ei if you
                  a) regress Y on T and predict the residual YRESi; regress X on T and predict the residual XRESi
                  b) regress YRESi on XRESi.

                  Another, not that popular version says that if you
                  a) regress X on T and predict the residual XRESi
                  b) regress Y on XRESi
                  you will obtain the same parameters but a different residual.

                  Finally regressing Y on T and predicting YRESi, and then regressing YRESi on X generally does not result neither in the same estimated parameters, nor in the same residual.

                  Comment


                  • #10
                    Regarding treating the time trend T as continuous or not, depends on what data you have.

                    If you have only one time series, then i.T will result in as many regressors as time periods you have, so you will be out of degrees of freedom.

                    With a single time series you need to treat time as a continuous variable, and if you want to make it more general, you can use some low order (second, third order) polynomial in time.

                    With panel data you can treat time fully nonparametrically by using i.T.

                    Comment


                    • #11
                      Thanks, Joro
                      Kind Regards

                      Comment

                      Working...
                      X