Announcement

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

  • #16
    also, if i use xtregar, it states "must specify timevar; use xtset".

    edit: would i not have to use some for function to get the regression results across the different industries?
    Last edited by Alex McGregor; 03 Jan 2021, 17:31.

    Comment


    • #17
      Alex:
      yes, Stata can do what you want within the constraints of -fe- specification (if you want to go that way, coefficients for time-invariant predictors will not be provided).
      As an aside, I think you meant that (assuming thyat you still want to go -fe-), you're interested in the within panel variation of the regressand conditional on the predictors included in the right-hand side of your regression equation.
      As far as your last post is concerned, since -xtregar- allows modelling -AR1- disturbances, the -timevar- is mandatory.
      Therefore, given that you have a T>N panel dataset and repeated time values within the same panel, in order to exploit -xtregar- capabilities, you should create a different -timevar-.
      Eventually, -i.industry- predictor can well be added onto the set of already existing regressors, but, as we discussed in the previous posts, under the -fe- specification, no -coefficient will be returned unless at least one firm changes industry during the time span the -timevar- stretches over.
      Last edited by Carlo Lazzaro; 04 Jan 2021, 02:30.
      Kind regards,
      Carlo
      (Stata 19.0)

      Comment


      • #18
        I appreciate your response Carlo, thank you.

        1. How is T>N, where the time variable is bigger than the panel variable. I do not understand this part.

        2. I am interested in the within panel variation of the regress and was thinking that maybe I need to do a nested loop or something? I need to do regressions for each industry and then absorb the effects as mentioned before, but don't know how to.

        3. I don't understand how should I create a different timevar?

        4. I do not want a coefficient for the industry necessarily so I think I should not add the industry variable. I need to run regression per industry as I want to find the effects of the dummy variable and the IV on the DV across different industries.

        Comment


        • #19
          Alex:
          1) in your case, the number of days at which variables are measured (timevar or T)are larger than the firms (panelid or N):
          2) & 4) if this is what you really want, you can do somethng along the following lines:
          Code:
          bysort industry: xtregar <depvar> <indepvar> <controls>
          3) you can arbitrarily add hours to days, for instance.

          Otherwise, you can skip all the previous stuff altogether and use -regress- (which might be inefficient vs -xtregar- as far as standard errors are concerned, but it's a sort of last resort for calculating -fe- you're interested in if anything else fails):
          Code:
          regress <depvar> <indepvars> i.firms i.industry, vce(cluster firm)
          Kind regards,
          Carlo
          (Stata 19.0)

          Comment


          • #20
            Hello Carlo,

            xtset works now. It still says it is unbalanced although I deleted all the empty observations. Not sure why.

            1. I have done
            bysort industry: xtregar <depvar> <indepvar>, fe but for all industries when dummy=1 it is omitted because of collinearity. I do not understand where this collinearity comes from and how to solve this issue as I cannot simply drop this dummy variable. Is it because of the interaction? 2. Also, can you please specify how I can absorb for the company, country, industry, and return affects? Is fe enough? How do I get the coefficients for these as my formula is DV_{i,c,j,t} = a_i+α_c+α_j+a_t+beta * (IV_i*Dummy_t)+e_{i,c,j,t}? Do I need to change my formula? 3. Does Stata know that the indepvar runs across industries whereas the dummy runs across time and the depvar across industry, time, company and country?

            Comment


            • #21
              Also, when I do the same but instead of fe i do re I do not "always" get "omitted because of collinearity, although I am not sure why. and sometimes i even get significant results.

              Comment


              • #22
                Alex:
                what you experience is due to the difference between -fe- and -re- machineries: while the first wipes out all time-invariant predictors, the second can estimate a coefficient for them, too.
                Last edited by Carlo Lazzaro; 30 Jan 2021, 02:54.
                Kind regards,
                Carlo
                (Stata 19.0)

                Comment


                • #23
                  Yes, I will use fixed effects but I do not know how to code it and make sure Stata knows the dimensions.

                  I tried xi: xtreg depvar c. indepvar#dummy i.daily i.industry, fe but I have daily data ranging for +5 years and it does not work. It also shows all the daily dates.
                  I also tried xtreg depvar c.indepvar#dummy, fe, which simply omits when dummy=1.

                  How do I include the different fixed effects (industry, daily, country, company)? It does not seem to work, especially because I did xtset date Company.

                  I am trying to see how the dependent variable reacts depending on dummy (time specified) and the independent variable (sector/company specified), while abosring for the different fixed effects.

                  Comment


                  • #24
                    Alex:
                    first, you should have -xtset- your data as:
                    Code:
                    xtset Company date
                    If you're looking for retrieving many fixed effects and you have N>T panel dataset, you can consider the community-contributed programme -reghdfe-, but it does not seem to be your case (as you have a T>N panel dataset).
                    Hence, if the -fe- specification is actually the way to go with your dataset, I would first kick out from the right-hand side of your regression equation those predictiora that you know on a priori basis that cannot be estimated by the -fe- machinery, being time-invariant (eg, industry).
                    Moreover, if you're interested in interactions, please note that you have to type a double ## between the interacted variables.
                    Kind regards,
                    Carlo
                    (Stata 19.0)

                    Comment


                    • #25
                      I did xtset my data as you said already.

                      I have T>N as the time periods (daily) are more than the panel members (companies), correct?

                      Can you elaborate on "kicking out"? Won't the firm effects absorb the industry effects?

                      Also, shouldn't my interaction NOT be time-invariant as it varies with the dummy variables' dates?

                      Comment


                      • #26
                        Alex:
                        1) kicking out: if you already know that a given predictor of your regression is time-invariant, you know from the start that, under -fe- specification, its coefficient will not be estimated: hence, there's no gain in including it in the right-hand side of your regression equation;
                        2) my comment about interaction highlighted that, in the greatest majority of the cases, the interactions should be coded with -##- so that the the conditional main effect of the predictors incluided in the interaction can be estimated, too.
                        Kind regards,
                        Carlo
                        (Stata 19.0)

                        Comment


                        • #27
                          I understand, thank you.

                          In this case the independent variable will be omitted as it is time-invariant.

                          Also, does the dependent variable have to be a nominal terms or can it be a percentage? Since I am looking at stock returns, should it be the increase in nominal terms (4.3-4.2 = 0.1) or percentage (4.3/4.2-1= 2.3%)?

                          Comment


                          • #28
                            Alex:
                            both of the way regressand is expressed will work, but the result explanation will change (variation in: nominal points; percentage points).
                            Kind regards,
                            Carlo
                            (Stata 19.0)

                            Comment


                            • #29
                              Thank you again Carlo.
                              It is just because when I use percentage points I get insignificant results and when I use nominal points i get significant results.
                              Related to this, I am planning on using abnormal returns, which is the difference between the return and benchmark. Is it possible to do this in nominal terms?

                              Comment


                              • #30
                                Alex:
                                it is difficul to give posistive replies to your first question without taking a look at what you typed and what Stata gave you back (as recommended by the FAQ).
                                As far as your second question is concerned, it depends on the customary rules of your research field.
                                Kind regards,
                                Carlo
                                (Stata 19.0)

                                Comment

                                Working...
                                X