Dear Statalist members,

First, I would like to take the occasion to thank the Statalist forum and its members, the forum has been extremely helpful over the past years. I do hope my first post is clear enough and follow the guidelines.

I am studying an unbalanced panel of around 25000 firms and wish to explore within-firm dynamics, precisely in which years firms have higher probability to do multi_event (a 3-outcome discrete variable).

To do so, I am relying on a multinomial logistic regression model with firm fixed effects (FE), estimated using the multinomial conditional logit estimator with femlogit: femlogit multi_event X1 X2, group(firmdum) robust or baseoutcome(0)
I am not resorting to an unconditional multinomial logit with firm dummies since, apart from the high number of firms, the incidental parameter bias is of concern, with on average only Tbar=10 years per fixed effect.

I understand that the standard interpretation of the estimated coefficients in femlogit, or in the single choice case with clogit, is limited to odds-ratio effects. Marginal effects, or effects in the probability scale, can't be obtained since the fixed effects are not estimated, one just have the option to run margins, pu0 (assuming firm FE=0).

In a single choice model, I still have the Linear probability models (LPM) with fixed-effects as an option to interpret the coefficients as effects on probabilities (if predicted probabilities are not off chart). In contrast, in a multiple choice model, I don't have this point of comparison (unless potentially running group-wise LPM regressions), and thus have only at hand odds-ratio effects.

My main question is: in a multinomial logit with e.g. 3 outcomes, does the comparison of the estimated odd-ratios for X1 across outcome 2 (outcome 2 vs base) and outcome 3 (outcome 3 vs base) hold also true in the probability scale. In other words, whether the difference observed in odd ratios across outcomes for X1 can be generalized to hold as well for marginal effects.

If this generalization is not obvious, then I am wondering if one could get approximative marginal effects in non-linear probability models. I tried to implement the following approach in a single choice model (if the approach is not invalid, I would extend it to the multiple choice case)

Tentative approach: Plug in the firm FE estimates from reghdfe into the unconditional predicted probabilities estimated by clogit with firm FE (inspired by Steve Samuels' post)
1. Retrieve estimates of firm FE after reghdfe : reghdfe event X1 X2 if nofirmvariation!=1, absorb(i.firmdum, savefe) vce(cluster firmdum)
2. Run clogit : clogit event X1 X2, group(firmdum) vce(cluster firmdum)
3. Compute manually the marginal effects: using predictions of -xb-, add the firm FE estimates from reghdfe, then convert to unconditional probabilities.


Side question: I would love to hear your thoughts on the plausibility of this approach, maybe this is a very bad idea.


Thank you very much in advance for your precious help,
Looking forward to hear your thoughts and suggestions,

Have a nice day,
Alex


PS: Please find below the code and output of running the tentative approach described above in the simplified single choice case.
At the very end, I included an example of the dataset.
*EVENT: dummy 0/1
*X1: continuous variable varying at the firm-year level
*X2: continuous variable varying at the country-year level



First, I retrieve estimates of firm fixed effects from a Linear Probability Model (LPM) regression, using reghdfe.
(note: I was not sure whether I needed to add the constant term to rawFEest, but after manually computing the firm FE, it seems the answer is no)

Code:
****Retrieve Estimates of Firm Fixed effects from REGHDFE------------------------------------------
reghdfe event X1 X2 if nofirmvariation!=1, absorb(i.firmdum, savefe) vce(cluster firmdum)
rename __hdfe1__ rawFEest
gen FEest= rawFEest + _b[_cons]

**ASIDE: Compute the firm FE estimates manually to check whether the constant term should be added to rawFEest
foreach var in "event" "X1" "X2" {
bysort firm (country industry year): egen avgf_`var'=mean(`var') if e(sample) // Average within each firm f
}
gen FEest_manual=avgf_event - _b[_cons] - _b[X1]*(avgf_X1) - _b[X2]*(avgf_X2)
sum FEest_manual rawFEest FEest

**Unconditional predicted probability
predict pp_lpm if e(sample)
sum pp_lpm, detail


*-----OUTPUT-----


. reghdfe event X1 X2 if nofirmvariation!=1, absorb(i.firmdum, savefe) vce(cluster firmdum)
(MWFE estimator converged in 1 iterations)

HDFE Linear regression                            Number of obs   =    269,981
Absorbing 1 HDFE group                            F(   2,  25257) =     175.94
Statistics robust to heteroskedasticity           Prob > F        =     0.0000
                                                  R-squared       =     0.1365
                                                  Adj R-squared   =     0.0474
                                                  Within R-sq.    =     0.0017
Number of clusters (firmdum) =     25,258         Root MSE        =     0.3451

                            (Std. Err. adjusted for 25258 clusters in firmdum)
------------------------------------------------------------------------------
             |               Robust
       event |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
          X1 |   .0395171   .0079009     5.00   0.000     .0240308    .0550034
          X2 |  -.5136119    .028185   -18.22   0.000    -.5688563   -.4583676
       _cons |    .153286   .0009816   156.16   0.000      .151362      .15521
------------------------------------------------------------------------------

Absorbed degrees of freedom:
-----------------------------------------------------+
 Absorbed FE | Categories  - Redundant  = Num. Coefs |
-------------+---------------------------------------|
     firmdum |     25258       25258           0    *|
-----------------------------------------------------+
* = FE nested within cluster; treated as redundant for DoF computation


 . sum FEest_manual rawFEest FEest

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
FEest_manual |    269981    2.68e-09    .1303356  -.1207063   .8160498
    rawFEest |    269981    1.45e-17    .1303356  -.1207064   .8160498
       FEest |    269981     .153286    .1303356   .0325796   .9693358

. sum pp_lpm, detail

                      Linear prediction
-------------------------------------------------------------
      Percentiles      Smallest
 1%     .1108034        .086305
 5%     .1241688       .0863215
10%     .1311853       .0864742       Obs              269981
25%     .1375512       .0865768       Sum of Wgt.      269981

50%     .1447993                      Mean           .1465214
                        Largest       Std. Dev.      .0154079
75%     .1534171       .2539552
90%     .1654797        .254718       Variance       .0002374
95%     .1751905       .2548589       Skewness        .816794
99%     .1944717       .2560252       Kurtosis       5.788015




****Retrieve marginal effects from CLOGIT (assuming firm FE=0)-----------------------------------
Secondly, I run the clogit with firm FE.
Code:
. clogit event X1 X2, group(firmdum) vce(cluster firmdum)
note: multiple positive outcomes within groups encountered.
note: 14978 groups (76115 obs) dropped because of all positive or
      all negative outcomes.

Iteration 0:   log pseudolikelihood = -72289.236  
Iteration 1:   log pseudolikelihood =  -72255.07  
Iteration 2:   log pseudolikelihood = -72255.061  
Iteration 3:   log pseudolikelihood = -72255.061  

Conditional (fixed-effects) logistic regression   Number of obs   =     269981
                                                  Wald chi2(2)    =     385.90
                                                  Prob > chi2     =     0.0000
Log pseudolikelihood = -72255.061                 Pseudo R2       =     0.0027

                            (Std. Err. adjusted for 25258 clusters in firmdum)
------------------------------------------------------------------------------
             |               Robust
       event |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
          X1 |   .3272275   .0660193     4.96   0.000      .197832     .456623
          X2 |  -4.027245   .2105671   -19.13   0.000    -4.439949   -3.614541
------------------------------------------------------------------------------

I check a couple of things:
  • whether the manually-computed unconditional predicted probabilities (assuming firm FE = 0) are done correctly:
Code:
predict pp_logit if e(sample), pu0
gen pp_logit_hand=invlogit(_b[X1]*X1 + _b[X2]*X2)
sum pp_logit pp_logit_hand if e(sample)

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
    pp_logit |    269981    .4872003     .030236   .3716399   .6938448
pp_logit_h~d |    269981    .4872003     .030236   .3716399   .6938448
  • whether the manually-computed marginal effects (assuming firm FE=0) are done correctly : (based on Jeff Pitblado's post)
    • AME, Average Marginal Effects (assuming firm FE=0)
Code:
margins, dydx(X1 X2) predict(pu0)

gen ame_dpdxb=pp_logit_hand*(1-pp_logit_hand)
gen ame_dpdx1=ame_dpdxb*_b[X1]
gen ame_dpdx2=ame_dpdxb*_b[X2]


gen ame_d2pdxb2=pp_logit_hand*(1-pp_logit_hand)*(1-pp_logit_hand) - pp_logit_hand*pp_logit_hand*(1-pp_logit_hand)

**FOR X1
matrix vecaccum Jac = ame_d2pdxb2 X1 X2, noconstant
matrix Jac = Jac*_b[X1]/e(N)
sum ame_dpdxb, meanonly
matrix Jac[1,1] = Jac[1,1] + r(mean)
matrix V = Jac*e(V)*Jac'
local ame_dpdx1_SE=sqrt(V[1,1])
*compute tstat
sum ame_dpdx1, meanonly
local ame_dpdx1=`r(mean)'
local ame_dpdx1_TS=`ame_dpdx1'/`ame_dpdx1_SE'

**FOR X2
matrix vecaccum Jac = ame_d2pdxb2 X1 X2, noconstant
matrix Jac = Jac*_b[X2]/e(N)
sum ame_dpdxb, meanonly
matrix Jac[1,2] = Jac[1,2] + r(mean)
matrix V = Jac*e(V)*Jac'
local ame_dpdx2_SE=sqrt(V[1,1])
*compute tstat
sum ame_dpdx2, meanonly
local ame_dpdx2=`r(mean)'
local ame_dpdx2_TS=`ame_dpdx2'/`ame_dpdx2_SE'

matrix AME = (`ame_dpdx1',`ame_dpdx1_SE',`ame_dpdx1_TS' \ `ame_dpdx2',`ame_dpdx2_SE',`ame_dpdx2_TS')
matrix colnames AME = dydx SE tstat
matrix rownames AME = X1 X2
matrix list AME



*-----OUTPUT-----

. margins, dydx(X1 X2) predict(pu0)

Average marginal effects                          Number of obs   =     269981
Model VCE    : Robust

Expression   : Pr(event|fixed effect is 0), predict(pu0)
dy/dx w.r.t. : X1 X2

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
          X1 |   .0814541   .0164296     4.96   0.000     .0492526    .1136556
          X2 |   -1.00247    .051975   -19.29   0.000    -1.104339   -.9006005
------------------------------------------------------------------------------


. matrix list AME

AME[2,3]
          dydx          SE       tstat
X1   .08145886   .01642863   4.9583474
X2  -1.0025282   .05186417  -19.329878
  • MEM, Marginal Effects at the Mean (of each covariates) (assuming firm FE=0)
Code:
margins, dydx(X1) at((mean) X2) predict(pu0)
margins, dydx(X2) at((mean) X1) predict(pu0)

foreach var in "X1" "X2" {
sum `var' if e(sample), meanonly
local `var'avg=`r(mean)'
}

**FOR X1, where X2 estimated at the mean and FE at 0
gen X1_ppatm_logit_hand=invlogit(_b[X1]*X1 + _b[X2]*`X2avg')
gen X1_mem_dpdxb=X1_ppatm_logit_hand*(1-X1_ppatm_logit_hand)
gen mem_dpdx1=X1_mem_dpdxb*_b[X1]

gen X1_mem_d2pdxb2=X1_ppatm_logit_hand*(1-X1_ppatm_logit_hand)*(1-X1_ppatm_logit_hand) - X1_ppatm_logit_hand*X1_ppatm_logit_hand*(1-X1_ppatm_logit_hand)
matrix vecaccum Jac = X1_mem_d2pdxb2 X1 X2, noconstant
matrix Jac = Jac*_b[X1]/e(N)
sum X1_mem_dpdxb, meanonly
matrix Jac[1,1] = Jac[1,1] + r(mean)
matrix V = Jac*e(V)*Jac'
local mem_dpdx1_SE=sqrt(V[1,1])
sum mem_dpdx1, meanonly
local mem_dpdx1=`r(mean)'
local mem_dpdx1_TS=`mem_dpdx1'/`mem_dpdx1_SE'

**FOR X2, where X1 estimated at the mean and FE at 0
gen X2_ppatm_logit_hand=invlogit(_b[X1]*`X1avg' + _b[X2]*X2)
gen X2_mem_dpdxb=X2_ppatm_logit_hand*(1-X2_ppatm_logit_hand)
gen mem_dpdx2=X2_mem_dpdxb*_b[X2]

gen X2_mem_d2pdxb2=X2_ppatm_logit_hand*(1-X2_ppatm_logit_hand)*(1-X2_ppatm_logit_hand) - X2_ppatm_logit_hand*X2_ppatm_logit_hand*(1-X2_ppatm_logit_hand)
matrix vecaccum Jac = X2_mem_d2pdxb2 X1 X2, noconstant
matrix Jac = Jac*_b[X2]/e(N)
sum X2_mem_dpdxb, meanonly
matrix Jac[1,2] = Jac[1,2] + r(mean)
matrix V = Jac*e(V)*Jac'
local mem_dpdx2_SE=sqrt(V[1,1])
sum mem_dpdx2, meanonly
local mem_dpdx2=`r(mean)'
local mem_dpdx2_TS=`mem_dpdx2'/`mem_dpdx2_SE'

matrix MEM = (`mem_dpdx1',`mem_dpdx1_SE',`mem_dpdx1_TS' \ `mem_dpdx2',`mem_dpdx2_SE',`mem_dpdx2_TS')
matrix colnames MEM = dydx SE tstat
matrix rownames MEM = X1 X2
matrix list MEM

*-----OUTPUT-----

. margins,dydx(X1) at((mean) X2) predict(pu0)

Average marginal effects                          Number of obs   =     269981
Model VCE    : Robust

Expression   : Pr(event|fixed effect is 0), predict(pu0)
dy/dx w.r.t. : X1
at           : X2              =    .0209772 (mean)

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
          X1 |   .0817094   .0164814     4.96   0.000     .0494065    .1140123
------------------------------------------------------------------------------

. margins,dydx(X2) at((mean) X1) predict(pu0)

Average marginal effects                          Number of obs   =     269981
Model VCE    : Robust

Expression   : Pr(event|fixed effect is 0), predict(pu0)
dy/dx w.r.t. : X2
at           : X1              =    .1014645 (mean)

------------------------------------------------------------------------------
             |            Delta-method
             |      dy/dx   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
          X2 |  -1.002985   .0520059   -19.29   0.000    -1.104915   -.9010556
------------------------------------------------------------------------------


. matrix list MEM

MEM[2,3]
          dydx          SE       tstat
X1   .08170772   .01647887    4.958333
X2  -1.0025974   .05187167  -19.328418
  • Aside: I tried also the two-sided numerical derivatives method to compute marginal effects, and it yields close results too (see e.g. below for the AME)
Code:
foreach Xvar in "X1" "X2" {
preserve
*Define small change h
qui sum `Xvar'
scalar h = (abs(r(mean))+0.0001)*0.0001
* Duplicate variable
clonevar `Xvar'_c = `Xvar'
* Small negative change
replace `Xvar' = `Xvar'_c - scalar(h)
predict double lw_0 if e(sample), pu0
* Small positive change
replace `Xvar'= `Xvar'_c + scalar(h)
predict double lw_1 if e(sample), pu0
gen double ALT_ame_dpdx = (lw_1-lw_0)/(2*scalar(h))
sum ALT_ame_dpdx if e(sample)
restore
}


  Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
ALT_ame_dpdx |    269981    .0814565      .00059   .0697007   .0820301

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
ALT_ame_dpdx |    269981    -1.00223    .0072679  -1.006872  -.8579575


​​​​​​​


So it seems the manually-computed marginal effects are close to the margin's command output.
Now, I finally plug in the Firm FE estimates retrieved from the LPM model above, in order to compute the marginal effects, but this time without assuming firm FE=0.

Code:
local firmFEused "rawFEest"

****AME Average Marginal Effects, PLUGGING NOW THE FE ESTIMATES FROM THE LPM MODEL ------------------------------

gen ppFE_logit_hand=invlogit(`firmFEused' + _b[X1]*X1 + _b[X2]*X2)
gen ameFE_dpdxb=ppFE_logit_hand*(1-ppFE_logit_hand)

**For X1:
gen ameFE_dpdx1=ameFE_dpdxb*_b[X1]
gen ameFE_d2pdxb2=ppFE_logit_hand*(1-ppFE_logit_hand)*(1-ppFE_logit_hand) - ppFE_logit_hand*ppFE_logit_hand*(1-ppFE_logit_hand)
matrix vecaccum Jac = ameFE_d2pdxb2 X1 X2, noconstant
matrix Jac = Jac*_b[X1]/e(N)
sum ameFE_dpdxb, meanonly
matrix Jac[1,1] = Jac[1,1] + r(mean)
matrix V = Jac*e(V)*Jac'
local ameFE_dpdx1_SE=sqrt(V[1,1])
sum ameFE_dpdx1, meanonly
local ameFE_dpdx1=`r(mean)'
local ameFE_dpdx1_TS=`ameFE_dpdx1'/`ameFE_dpdx1_SE'

**For X2:
gen ameFE_dpdx2=ameFE_dpdxb*_b[X2]
matrix vecaccum Jac = ameFE_d2pdxb2 X1 X2, noconstant
matrix Jac = Jac*_b[X2]/e(N)
sum ameFE_dpdxb, meanonly
matrix Jac[1,2] = Jac[1,2] + r(mean)
matrix V = Jac*e(V)*Jac'
local ameFE_dpdx2_SE=sqrt(V[1,1])
sum ameFE_dpdx2, meanonly
local ameFE_dpdx2=`r(mean)'
local ameFE_dpdx2_TS=`ameFE_dpdx2'/`ameFE_dpdx2_SE'

matrix  AMEFE = (`ameFE_dpdx1',`ameFE_dpdx1_SE',`ameFE_dpdx1_TS' \ `ameFE_dpdx2',`ameFE_dpdx2_SE',`ameFE_dpdx2_TS') 
matrix colnames AMEFE = dydx SE tstat 
matrix rownames AMEFE = X1 X2



****MEM Marginal effects at the Mean (of each covariates), PLUGGING NOW THE FE ESTIMATES FROM THE LPM MODEL ------------------------------    

foreach var in "`firmFEused'" "X1" "X2" {
sum `var' if e(sample)
local `var'avg=`r(mean)'
}

**for X1, where X2 estimated at the mean and FE at 0
gen X1_ppFEatm_logit_hand=invlogit(``firmFEused'avg' + _b[X1]*X1 + _b[X2]*`X2avg')
gen X1_memFE_dpdxb=X1_ppFEatm_logit_hand*(1-X1_ppFEatm_logit_hand)
gen memFE_dpdx1=X1_memFE_dpdxb*_b[X1]

gen X1_memFE_d2pdxb2=X1_ppFEatm_logit_hand*(1-X1_ppFEatm_logit_hand)*(1-X1_ppFEatm_logit_hand) - X1_ppFEatm_logit_hand*X1_ppFEatm_logit_hand*(1-X1_ppFEatm_logit_hand)
matrix vecaccum Jac = X1_memFE_d2pdxb2 X1 X2, noconstant
matrix Jac = Jac*_b[X1]/e(N)
sum X1_memFE_dpdxb, meanonly
matrix Jac[1,1] = Jac[1,1] + r(mean)
matrix V = Jac*e(V)*Jac'
local memFE_dpdx1_SE=sqrt(V[1,1])
sum memFE_dpdx1, meanonly
local memFE_dpdx1=`r(mean)'
local memFE_dpdx1_TS=`memFE_dpdx1'/`memFE_dpdx1_SE'


**for X2, where X1 estimated at the mean and FE at 0
gen X2_ppFEatm_logit_hand=invlogit(``firmFEused'avg' + _b[X1]*`X1avg' + _b[X2]*X2)
gen X2_memFE_dpdxb=X2_ppFEatm_logit_hand*(1-X2_ppFEatm_logit_hand)
gen memFE_dpdx2=X2_memFE_dpdxb*_b[X2]

gen X2_memFE_d2pdxb2=X2_ppFEatm_logit_hand*(1-X2_ppFEatm_logit_hand)*(1-X2_ppFEatm_logit_hand) - X2_ppFEatm_logit_hand*X2_ppFEatm_logit_hand*(1-X2_ppFEatm_logit_hand)
matrix vecaccum Jac = X2_memFE_d2pdxb2 X1 X2, noconstant
matrix Jac = Jac*_b[X2]/e(N)
sum X2_memFE_dpdxb, meanonly
matrix Jac[1,2] = Jac[1,2] + r(mean)
matrix V = Jac*e(V)*Jac'
local memFE_dpdx2_SE=sqrt(V[1,1])
sum memFE_dpdx2, meanonly
local memFE_dpdx2=`r(mean)'
local memFE_dpdx2_TS=`memFE_dpdx2'/`memFE_dpdx2_SE'

matrix  MEMFE = (`memFE_dpdx1',`memFE_dpdx1_SE',`memFE_dpdx1_TS' \ `memFE_dpdx2',`memFE_dpdx2_SE',`memFE_dpdx2_TS')
matrix colnames MEMFE = dydx SE tstat
matrix rownames MEMFE = X1 X2



matrix list AME
matrix list AMEFE
matrix list MEM
matrix list MEMFE
      

    

*-----OUTPUT-----

. matrix list AME

AME[2,3]
          dydx          SE       tstat
X1   .08145886   .01642863   4.9583474
X2  -1.0025282   .05186417  -19.329878

. matrix list AMEFE

AMEFE[2,3]
          dydx          SE       tstat
X1   .08114175   .01637016    4.956686
X2  -.99862547    .0517826  -19.284962

. matrix list MEM

MEM[2,3]
          dydx          SE       tstat
X1   .08170772   .01647887    4.958333
X2  -1.0025974   .05187167  -19.328418

. matrix list MEMFE

MEMFE[2,3]
          dydx          SE       tstat
X1   .08170772   .01647887    4.958333
X2  -1.0025974   .05187167  -19.328418
So the difference between AME vs. AMEFE or MEM vs MEMFE is very small, which is not so surprising as the average of firm FE estimates is close to 0.











----------------------- copy starting from the next line -----------------------
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input str12 country byte industry str10 firm double year float(event multi_event X1 X2 ctrydum inddum firmdum timedum nofirmvariation)
"DE" 46 "firm 13806" 2006 0 0   .007530669  .007218538  9 27 13806 11 .
"DE" 46 "firm 13806" 2007 0 0 .00012527796   .03814588  9 27 13806 12 .
"DE" 46 "firm 13806" 2009 0 0  .0004691165  .009622664  9 27 13806 14 .
"DE" 46 "firm 13806" 2010 1 1 .00037504805  -.05697152  9 27 13806 15 .
"DE" 46 "firm 13806" 2011 0 0   .007317938   .04178969  9 27 13806 16 .
"DE" 46 "firm 13806" 2012 0 0   .013341079   .03924133  9 27 13806 17 .
"DE" 46 "firm 13806" 2013 0 0 .00006747866  .004195511  9 27 13806 18 .
"DE" 46 "firm 13806" 2014 0 0 .00006560474 .0042824326  9 27 13806 19 .
"BE" 46 "firm 1906"  1996 0 0   .000805153   .02384757  3 27  1906  1 .
"BE" 46 "firm 1906"  1998 0 0   .002904866   .03793645  3 27  1906  3 .
"BE" 46 "firm 1906"  1999 0 0  .0007342144  .019618407  3 27  1906  4 .
"BE" 46 "firm 1906"  2000 0 0    .04224626  .035427343  3 27  1906  5 .
"BE" 46 "firm 1906"  2002 0 0   .001313485  .010996162  3 27  1906  7 .
"BE" 46 "firm 1906"  2003 0 0  .0011811024   .01706889  3 27  1906  8 .
"BE" 46 "firm 1906"  2004 0 0    .04105062   .01037953  3 27  1906  9 .
"BE" 46 "firm 1906"  2005 0 0 .00020165356   .03571193  3 27  1906 10 .
"BE" 46 "firm 1906"  2006 0 0  .0001662234  .023217374  3 27  1906 11 .
"BE" 46 "firm 1906"  2007 0 0  .0004821601   .02552354  3 27  1906 12 .
"BE" 46 "firm 1906"  2008 0 0  .0004884005   .03676918  3 27  1906 13 .
"BE" 46 "firm 1906"  2009 0 0 .00057186425 .0044691656  3 27  1906 14 .
"BE" 46 "firm 1906"  2010 1 1  .0016335762  -.02020726  3 27  1906 15 .
"BE" 46 "firm 1906"  2011 1 1  .0019276562  .028642854  3 27  1906 16 .
"BE" 46 "firm 1906"  2012 0 0    .02089619  .016944975  3 27  1906 17 .
"BE" 46 "firm 1906"  2013 0 0    .02124319  .007392299  3 27  1906 18 .
"BE" 46 "firm 1906"  2014 0 0    .01247619 .0045922804  3 27  1906 19 .
"BE" 46 "firm 1906"  2015 0 0  .0012133245  .015785232  3 27  1906 20 .
"ES" 27 "firm 20001" 1996 0 0    .07557697   .02757494 12 16 20001  1 .
"ES" 27 "firm 20001" 1997 0 0   .010662605  .026605245 12 16 20001  2 .
"ES" 27 "firm 20001" 1998 0 0   .020112457    .0370258 12 16 20001  3 .
"ES" 27 "firm 20001" 1999 0 0    .02070117   .04393037 12 16 20001  4 .
"ES" 27 "firm 20001" 2000 0 0   .010628875   .04490491 12 16 20001  5 .
"ES" 27 "firm 20001" 2001 0 0     .1540766   .05245995 12 16 20001  6 .
"ES" 27 "firm 20001" 2002 0 0    .14902854   .03932949 12 16 20001  7 .
"ES" 27 "firm 20001" 2003 0 0     .1234847   .02731022 12 16 20001  8 .
"ES" 27 "firm 20001" 2004 0 0    .09776207   .02981895 12 16 20001  9 .
"ES" 27 "firm 20001" 2005 0 0    .08563498   .03122795 12 16 20001 10 .
"ES" 27 "firm 20001" 2006 1 2    .11292415   .03652033 12 16 20001 11 .
"ES" 27 "firm 20001" 2007 0 0    .10470952   .04102727 12 16 20001 12 .
"ES" 27 "firm 20001" 2008 0 0    .02413675   .03604688 12 16 20001 13 .
"ES" 27 "firm 20001" 2009 0 0    .00967452  .008871452 12 16 20001 14 .
"ES" 27 "firm 20001" 2010 0 0   .011395238  -.03763232 12 16 20001 15 .
"ES" 27 "firm 20001" 2011 0 0    .05704423 .0016301023 12 16 20001 16 .
"ES" 27 "firm 20001" 2012 0 0    .03585518 -.008143734 12 16 20001 17 .
"ES" 27 "firm 20001" 2013 0 0    .00473983 -.029594414 12 16 20001 18 .
"ES" 27 "firm 20001" 2014 0 0   .026067436 -.014353943 12 16 20001 19 .
"ES" 27 "firm 20001" 2015 0 0    .04139135   .01383908 12 16 20001 20 .
"ES" 61 "firm 24972" 2005 0 0    .26048952   .03122795 12 38 24972 10 .
"ES" 61 "firm 24972" 2008 0 0    .05243991   .03604688 12 38 24972 13 .
"ES" 61 "firm 24972" 2009 0 0  .0006430868  .008871452 12 38 24972 14 .
"ES" 61 "firm 24972" 2010 0 0    .08017136  -.03763232 12 38 24972 15 .
"ES" 61 "firm 24972" 2011 1 1    .05170976 .0016301023 12 38 24972 16 .
"ES" 61 "firm 24972" 2012 0 0   .033775117 -.008143734 12 38 24972 17 .
"ES" 61 "firm 24972" 2013 0 0   .014409222 -.029594414 12 38 24972 18 .
"ES" 61 "firm 24972" 2014 0 0    .02092249 -.014353943 12 38 24972 19 .
"ES" 61 "firm 24972" 2015 0 0   .016916694   .01383908 12 38 24972 20 .
"ES" 41 "firm 25549" 2003 0 0    .01465605   .02731022 12 23 25549  8 .
"ES" 41 "firm 25549" 2004 1 1    .05502063   .02981895 12 23 25549  9 .
"ES" 41 "firm 25549" 2005 0 0    .26640338   .03122795 12 23 25549 10 .
"ES" 41 "firm 25549" 2006 0 0    .14507413   .03652033 12 23 25549 11 .
"ES" 41 "firm 25549" 2007 0 0     .5106934   .04102727 12 23 25549 12 .
"ES" 41 "firm 25549" 2008 0 0     .6000375   .03604688 12 23 25549 13 .
"ES" 41 "firm 25549" 2010 0 0   .003750854  -.03763232 12 23 25549 15 .
"ES" 41 "firm 25549" 2011 0 0 .00055234646 .0016301023 12 23 25549 16 .
"ES" 41 "firm 25549" 2012 0 0   .003455691 -.008143734 12 23 25549 17 .
"ES" 41 "firm 25549" 2013 0 0   .004863855 -.029594414 12 23 25549 18 .
"FR" 58 "firm 32964" 2007 0 0     .1693893  .024493236 14 35 32964 12 .
"FR" 58 "firm 32964" 2009 0 0    .12629724 .0025494595 14 35 32964 14 .
"FR" 58 "firm 32964" 2010 1 1     .1587848  -.02873314 14 35 32964 15 .
"FR" 58 "firm 32964" 2012 0 0    .12755804  .021927007 14 35 32964 17 .
"FR" 58 "firm 32964" 2013 0 0     .0775061 .0031313475 14 35 32964 18 .
"FR" 58 "firm 32964" 2014 0 0   .007359078  .005763267 14 35 32964 19 .
"FR" 58 "firm 32964" 2015 0 0    .02411685   .00956183 14 35 32964 20 .
"FR" 18 "firm 35434" 1997 0 0    .07684964  .014129937 14  8 35434  2 .
"FR" 18 "firm 35434" 1998 0 0    .14240558  .023362964 14  8 35434  3 .
"FR" 18 "firm 35434" 1999 0 0    .08149277  .035886593 14  8 35434  4 .
"FR" 18 "firm 35434" 2000 0 0    .06553164  .034213737 14  8 35434  5 .
"FR" 18 "firm 35434" 2001 0 0    .07580424   .03923669 14  8 35434  6 .
"FR" 18 "firm 35434" 2002 0 0   .023046093  .019837214 14  8 35434  7 .
"FR" 18 "firm 35434" 2003 0 0    .14968815  .011355315 14  8 35434  8 .
"FR" 18 "firm 35434" 2004 0 0    .20776594  .008231608 14  8 35434  9 .
"FR" 18 "firm 35434" 2005 0 0    .15917543   .02829753 14  8 35434 10 .
"FR" 18 "firm 35434" 2006 0 0    .01181638    .0166322 14  8 35434 11 .
"FR" 18 "firm 35434" 2007 0 0    .02830189  .024493236 14  8 35434 12 .
"FR" 18 "firm 35434" 2008 0 0  .0009301927  .024247363 14  8 35434 13 .
"FR" 18 "firm 35434" 2009 0 0  .0029125444 .0025494595 14  8 35434 14 .
"FR" 18 "firm 35434" 2010 0 0   .022513064  -.02873314 14  8 35434 15 .
"FR" 18 "firm 35434" 2011 1 1     .0758276  .019494377 14  8 35434 16 .
"FR" 18 "firm 35434" 2012 0 0  .0013445945  .021927007 14  8 35434 17 .
"FR" 18 "firm 35434" 2013 0 0   .001444512 .0031313475 14  8 35434 18 .
"FR" 18 "firm 35434" 2014 0 0  .0016024485  .005763267 14  8 35434 19 .
"FR" 18 "firm 35434" 2015 0 0   .006279731   .00956183 14  8 35434 20 .
"GB" 49 "firm 42847" 2000 0 0        .0088  .034282234 15 29 42847  5 .
"GB" 49 "firm 42847" 2001 1 1 .00056116725  .034374718 15 29 42847  6 .
"GB" 49 "firm 42847" 2002 0 0    .12946428  .029743636 15 29 42847  7 .
"GB" 49 "firm 42847" 2003 0 0     .1889327   .02324351 15 29 42847  8 .
"GB" 49 "firm 42847" 2004 1 1     .2919654  .032863777 15 29 42847  9 .
"GB" 49 "firm 42847" 2005 0 0    .26535514  .023739515 15 29 42847 10 .
"GB" 49 "firm 42847" 2006 0 0    .00737489   .03179729 15 29 42847 11 .
"GB" 49 "firm 42847" 2007 1 1  .0022311942  .027883245 15 29 42847 12 .
"GB" 49 "firm 42847" 2008 1 2  .0003995574   .02430553 15 29 42847 13 .
end
label var country "Country ISO code" 
label var event "Binary dependent variable, 0/1" 
label var multi_event "Categorical dependent variable with 3 outcomes, 0/1/2" 
label var X1 "Continuous variable varying at the firm-year level" 
label var X2 "Continuous variable varying at the country-year level" 
label var ctrydum "group(country_isocode)" 
label var inddum "group(nace2_2dig)" 
label var firmdum "group(uniqueid)" 
label var timedum "group(year)" 
label var nofirmvariation "Firms who don't show variation in event, 0 otherwise"
------------------ copy up to and including the previous line ------------------