Announcement

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

  • Control time effects for quarterly data

    Hi everyone,

    I'm a student and I am quite new to Stata. I'm doing my thesis and being stuck at this point. I hope that you can help me with your precious advice.

    As you can see in the picture in the last column, I have a quarterly time series. I wonder how I can control time effects by using Stata with this kind of data.

    I really appreciate your time and kindness.

    Click image for larger version

Name:	Screenshot 2021-02-25 223710.png
Views:	1
Size:	57.0 KB
ID:	1595039

  • #2
    Louis:
    short answer:
    Code:
    i.time
    What I can't get from your post is whether you're going to do a panel data regression with a continuous regressand.
    Is that were the case, -reshape- your data in -long- format and see -xtreg-.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Originally posted by Carlo Lazzaro View Post
      Louis:
      short answer:
      Code:
      i.time
      What I can't get from your post is whether you're going to do a panel data regression with a continuous regressand.
      Is that were the case, -reshape- your data in -long- format and see -xtreg-.
      Thank you for your reply

      I think my data is not a panel data set. It's simply the quarterly data though. In this case, am i right that i only need to put i.time to my regress command. Like this:
      "regress droa froa fshare gdp_gr i r agr cgr car i.time"

      However, the result showed is very weird. there is collinearity problems and the r squared equals to 1.

      Hope you can help

      Click image for larger version

Name:	error 2.png
Views:	1
Size:	63.2 KB
ID:	1595583

      Comment


      • #4
        Luis:
        what if you omit -i.time- from the set of your predictors?
        Another option: what if you investigate a possible turning point:
        Code:
        c.time##c.time
        ?
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          The problem is the way you have coded your quarters. You need to create 4 variables (not 4 for each year) for quarters then do i.quarter instead of i.time

          Comment


          • #6
            recoding quarters then using i.quarter will take care of the seasonal effects. but if you want to also control or factor in the time trend just create a new variable 1-N (gen trend=_n) assuming there is a single observation for each quarter. if not you can still work with it but then you would be working with panel data

            Comment


            • #7
              Louis Tran What i meant by create 4 variables for each quarter was that you will have one variable named quarter. But that variable will have a unique value for the same quarter over time. For example, you can put 1 for Q1, 2 for Q2, 3, for Q3, and 4 for Q4. i.quarter will treat them as a category rather than as a numerical number. just to make sure my poor explanation does not lead you in the wrong path

              Comment

              Working...
              X