Announcement

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

  • Regression Equation with Intercept and Trend.

    Hello,

    Please i wanted to know how i can include a Time trend in a regression equation. I actually run a panel data, where my model 1 and 2 all give a negative constant (intercept). However, my Supervisor asked me to include constant and time i.e. intercept and trend in the equation.

    Note that i did conduct Panel Unit root and all the variables are stationary at level.

    Am kind of confuse, how do i go about that. Try consulting materials but i couldn't find relevant topic on this. Kindly assist plz.
    Attached Files

  • #2
    To add a trend, include your time variable as an independent variable in your regression.

    Comment


    • #3
      Thanks Jesses for your kind reply.

      Please for more understanding about what you said, can you make an illustration with a regression equation?

      Thanks.

      Comment


      • #4
        Code:
        sysuse xtline1, clear
        gen x = runiform()
        
        ** No trend
        reg calories x
        
        ** With trend
        reg calories x day

        Comment


        • #5
          Olalere:
          you shoud plug in time as a continuous variable among your predictors:
          Code:
          c.time
          If you are also willing to investigate whether time trend has a turning point, you can consider the following:
          Code:
          c.time#c.time
          See -help fvvarlist- for more on this topic.
          Kind regards,
          Carlo
          (Stata 19.0)

          Comment


          • #6
            Thanks Carlo.

            As a follow up question, how can i use it as a command in stata?

            Comment


            • #7
              Olalere:
              please post what you have typed in Stata and helping you out will be easier. Thanks.
              That said, it would be something along the following lines:
              Code:
              xtreg <yourdepvar> <otherpredictors> c.time#c.time, re///assuming that you use random effect specification; otherwise, if you go fixed effect, simply replace -re- with -fe-
              Last edited by Carlo Lazzaro; 29 Jul 2016, 11:12.
              Kind regards,
              Carlo
              (Stata 19.0)

              Comment


              • #8
                Thanks Carlo.
                I've attached the command i use in stata.

                Seems its nt recognising the command. Futher help frm yu will be appreciated. Thanks
                Attached Files

                Comment


                • #9
                  Originally posted by Jesse Wursten View Post
                  Code:
                  sysuse xtline1, clear
                  gen x = runiform()
                  
                  ** No trend
                  reg calories x
                  
                  ** With trend
                  reg calories x day
                  Am not really clear about this either Jesse Wursten.

                  Comment


                  • #10
                    You say in post #1 that you have panel data. That means that at some point you used the xtset to tell Stata (1) the name of the variable that identifies your panels and (2) the name of the variable that identifies your times. It is that second variable on the xtset command that you need to add to your equation to introduce a time trend.

                    Because you have not told us anything about your variable names, each of the previous posters has used "time" as the name of the variable. But then in post #8 you included "time" in your equation, even though "time" is not a variable in your data. And Stata told you that - it says "variable time is not found". You need to include the variable in your panel data that identifies the time of the observation.

                    At this time some well-meant advice is in order. Please review the Statalist FAQ linked to from the top of the page, as well as from the Advice on Posting link on the page you used to create your post. See especially sections 9-12 on how to best pose your question. It's particularly helpful to copy commands and output from your Stata Results window and paste them into your Statalist post using CODE delimiters, as described in section 12 of the FAQ. In general it is not helpful to take pictures with your cell phone and post them. You are better advised to use the web browser on your Stata computer to connect to Statalist so you can copy and paste between your Stata Results window and your posts on Statalist.

                    Comment


                    • #11


                      Carlo, thanks for your advice. I got this results, please how do i include the time variable in equation form?
                      A simple illustration will be appreciated. Many thanks

                      Note: xtset was;

                      Panel variable: Bank (strongly balanced)

                      time variable: Year, 2009................2015

                      Comment


                      • #12
                        Olalere:
                        you provide only a small part of your code and nothing about the output you got from Stata.
                        Please take a look at FAQ #12 and get familiar with code delimiters. Thanks.
                        Kind regards,
                        Carlo
                        (Stata 19.0)

                        Comment


                        • #13
                          [xtreg ROA CR1 CR2 LR OR MR SIZE GDP c.year#c.year][/, fe]

                          where ROA is the dependent variable. However, i did attach the result from stata in the earlier comment.

                          Comment


                          • #14
                            As others have noted, you need to familiarize yourself with the Statalist FAQS on how to post output from Stata. That said, you call your time variable Year, so replace c.time or c.year with c.Year

                            Comment


                            • #15
                              Olalere:
                              as an aside to Andrew's helpful remark, please do not attach screenshots of your Stata session, as they often do not come through and, if they do, it's impossible to comment on.
                              The way you should have posted your results is instead:
                              Code:
                              xtreg ROA CR1 CR2 LR OR MR SIZE GDP c.year#c.year, fe
                              Eventually, from a methdological viewpoint, I assume that you have already investigated whether -fe- specificatiion outperforms -re- one for your data.
                              If this were not the case, you should take a look at -help hausman-.
                              Kind regards,
                              Carlo
                              (Stata 19.0)

                              Comment

                              Working...
                              X