Here is a sample of my dataset:
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input float trials long diseases int year float(eligible after) 0 1 2000 0 0 0 1 2001 0 0 1 1 2002 0 0 0 1 2003 0 0 0 1 2004 0 0 11 1 2005 0 0 5 1 2006 0 0 8 1 2007 0 1 5 1 2008 0 1 8 1 2009 0 1 10 1 2010 0 1 7 1 2011 0 1 8 1 2012 0 1 7 1 2013 0 1 9 1 2014 0 1 5 1 2015 0 1 13 1 2016 0 1 12 1 2017 0 1 11 1 2018 0 1 0 2 2000 1 0 0 2 2001 1 0 0 2 2002 1 0 0 2 2003 1 0 0 2 2004 1 0 0 2 2005 1 0 1 2 2006 1 0 0 2 2007 1 1 0 2 2008 1 1 0 2 2009 1 1 0 2 2010 1 1 0 2 2011 1 1 1 2 2012 1 1 0 2 2013 1 1 1 2 2014 1 1 0 2 2015 1 1 0 2 2016 1 1 0 2 2017 1 1 0 2 2018 1 1 0 3 2000 1 0 0 3 2001 1 0 0 3 2002 1 0 0 3 2003 1 0 0 3 2004 1 0 1 3 2005 1 0 1 3 2006 1 0 0 3 2007 1 0 2 3 2008 1 0 0 3 2009 1 0 1 3 2010 1 0 2 3 2011 1 0 9 3 2012 1 0 0 3 2013 1 0 3 3 2014 1 0 5 3 2015 1 1 0 3 2016 1 1 2 3 2017 1 1 1 3 2018 1 1 0 4 2000 1 0 0 4 2001 1 0 0 4 2002 1 0 0 4 2003 1 0 0 4 2004 1 0 0 4 2005 1 0 1 4 2006 1 0 0 4 2007 1 1 0 4 2008 1 1 0 4 2009 1 1 1 4 2010 1 1 0 4 2011 1 1 1 4 2012 1 1 0 4 2013 1 1 4 4 2014 1 1 3 4 2015 1 1 3 4 2016 1 1 6 4 2017 1 1 5 4 2018 1 1 0 5 2000 1 0 0 5 2001 1 0 0 5 2002 1 0 0 5 2003 1 0 0 5 2004 1 0 5 5 2005 1 0 1 5 2006 1 0 2 5 2007 1 1 6 5 2008 1 1 1 5 2009 1 1 4 5 2010 1 1 0 5 2011 1 1 3 5 2012 1 1 3 5 2013 1 1 4 5 2014 1 1 2 5 2015 1 1 2 5 2016 1 1 3 5 2017 1 1 5 5 2018 1 1 0 6 2000 1 0 0 6 2001 1 0 0 6 2002 1 0 0 6 2003 1 0 0 6 2004 1 0 end label values diseases diseases label def diseases 1 "Ischemic heart disease", modify label def diseases 2 "buruli", modify label def diseases 3 "chagas", modify label def diseases 4 "chikungunya", modify label def diseases 5 "cholera", modify label def diseases 6 "congo fever", modify
Code:
xtset diseases year
Code:
xtpoisson trials i.after##i.eligible user_fee PRV_value_lag_1 i.year, fe vce(robust)
note: 1 group (19 obs) dropped because of all zero outcomes
Iteration 0: log pseudolikelihood = -3482.899
Iteration 1: log pseudolikelihood = -1438.5172
Iteration 2: log pseudolikelihood = -1326.6942
Iteration 3: log pseudolikelihood = -1323.9955
Iteration 4: log pseudolikelihood = -1323.9843
Iteration 5: log pseudolikelihood = -1323.9843
Conditional fixed-effects Poisson regression Number of obs = 760
Group variable: diseases Number of groups = 40
Obs per group:
min = 19
avg = 19.0
max = 19
Wald chi2(21) = 541403.70
Log pseudolikelihood = -1323.9843 Prob > chi2 = 0.0000
(Std. Err. adjusted for clustering on diseases)
---------------------------------------------------------------------------------
| Robust
trials | Coef. Std. Err. z P>|z| [95% Conf. Interval]
----------------+----------------------------------------------------------------
1.after | .7540807 .617699 1.22 0.222 -.4565871 1.964748
1.eligible | 0 (omitted)
|
after#eligible |
1 1 | -.2196316 .1756016 -1.25 0.211 -.5638045 .1245412
|
user_fee | 1.03e-08 2.06e-08 0.50 0.618 -3.02e-08 5.07e-08
PRV_value_lag_1 | 5.30e-10 6.08e-10 0.87 0.383 -6.61e-10 1.72e-09
|
year |
2001 | -.2732933 .2078431 -1.31 0.189 -.6806583 .1340717
2002 | .4410561 .1786783 2.47 0.014 .0908531 .791259
2003 | .4480247 .1444247 3.10 0.002 .1649575 .7310919
2004 | .5901992 .1549172 3.81 0.000 .286567 .8938314
2005 | 2.292754 .3627732 6.32 0.000 1.581732 3.003777
2006 | 2.255858 .3615834 6.24 0.000 1.547167 2.964549
2007 | 1.4224 .6965394 2.04 0.041 .0572083 2.787593
2008 | 1.504672 .6946449 2.17 0.030 .1431928 2.866151
2009 | 1.423661 .6912332 2.06 0.039 .0688686 2.778453
2010 | 1.338251 .7091325 1.89 0.059 -.0516231 2.728125
2011 | 1.362411 .7026438 1.94 0.053 -.0147454 2.739568
2012 | 1.420266 .7100725 2.00 0.045 .0285491 2.811982
2013 | 1.45651 .6847051 2.13 0.033 .114513 2.798508
2014 | 1.551972 .6872168 2.26 0.024 .2050519 2.898892
2015 | 1.657939 .6661534 2.49 0.013 .3523026 2.963576
2016 | 1.656704 .6659423 2.49 0.013 .3514812 2.961927
2017 | 1.644959 .6718924 2.45 0.014 .3280741 2.961844
2018 | 1.532055 .6453066 2.37 0.018 .2672774 2.796833
---------------------------------------------------------------------------------
I then want to estimate the marginal effect for the interaction between after and eligible:
Code:
. margins after#eligible, predict(nu0)
Predictive margins Number of obs = 760
Model VCE : Robust
Expression : Predicted number of events (assuming u_i=0), predict(nu0)
--------------------------------------------------------------------------------
| Delta-method
| Margin Std. Err. z P>|z| [95% Conf. Interval]
---------------+----------------------------------------------------------------
after#eligible |
0 0 | 4.678461 2.342815 2.00 0.046 .0866278 9.270295
0 1 | 4.678461 2.342815 2.00 0.046 .0866278 9.270295
1 0 | 9.944802 4.023562 2.47 0.013 2.058765 17.83084
1 1 | 7.983831 2.830039 2.82 0.005 2.437056 13.53061
--------------------------------------------------------------------------------
Thank you very much!
0 Response to identical marginal effects after xtpoisson with fixed-effects
Post a Comment