Announcement

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

  • Using fe with panel data

    How often do I need to include ", fe" after my regressions when I am using panel data? For example I have a list of 100 companies with 10 years of data for each company, my dependent variable is staying the same with each regression, however my independent variables are changing. Do I need to put fe after each regression?

  • #2
    Yes.

    Comment


    • #3
      Do not forget
      Code:
      i.time
      in the list of regressors for time fixed-effects as well

      Comment


      • #4
        Jane:
        if you do not specify -fe-, Stata reads your code as you were willing to go -re-, as you can see from the following, deliberately poor, toy-example:
        Code:
        . use "https://www.stata-press.com/data/r17/nlswork.dta"
        (National Longitudinal Survey of Young Women, 14-24 years old in 1968)
        
        . xtreg ln_wage c.age
        
        Random-effects GLS regression                   Number of obs     =     28,510
        Group variable: idcode                          Number of groups  =      4,710
        
        R-squared:                                      Obs per group:
             Within  = 0.1026                                         min =          1
             Between = 0.0877                                         avg =        6.1
             Overall = 0.0774                                         max =         15
        
                                                        Wald chi2(1)      =    3140.35
        corr(u_i, X) = 0 (assumed)                      Prob > chi2       =     0.0000
        
        ------------------------------------------------------------------------------
             ln_wage | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
        -------------+----------------------------------------------------------------
                 age |   .0185667   .0003313    56.04   0.000     .0179174    .0192161
               _cons |   1.120439   .0112038   100.01   0.000      1.09848    1.142398
        -------------+----------------------------------------------------------------
             sigma_u |  .36972456
             sigma_e |  .30349389
                 rho |  .59743613   (fraction of variance due to u_i)
        ------------------------------------------------------------------------------
        
        . xtreg ln_wage c.age, re
        
        Random-effects GLS regression                   Number of obs     =     28,510
        Group variable: idcode                          Number of groups  =      4,710
        
        R-squared:                                      Obs per group:
             Within  = 0.1026                                         min =          1
             Between = 0.0877                                         avg =        6.1
             Overall = 0.0774                                         max =         15
        
                                                        Wald chi2(1)      =    3140.35
        corr(u_i, X) = 0 (assumed)                      Prob > chi2       =     0.0000
        
        ------------------------------------------------------------------------------
             ln_wage | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
        -------------+----------------------------------------------------------------
                 age |   .0185667   .0003313    56.04   0.000     .0179174    .0192161
               _cons |   1.120439   .0112038   100.01   0.000      1.09848    1.142398
        -------------+----------------------------------------------------------------
             sigma_u |  .36972456
             sigma_e |  .30349389
                 rho |  .59743613   (fraction of variance due to u_i)
        ------------------------------------------------------------------------------
        
        .
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment

        Working...
        X