Dear Listers,
I am running a linear fixed-effects (within) regression model including an interaction between one variable that is constant within panels and one variable that varies within panels.
I want to inspect this interaction graphically and therefore want to obtain adjusted predictions using the margins command. However, Stata seems to be unable to estimate what I want. Here is an illustrating example:
The (relevant) output is
I do not really understand what the problem is. Is there a theoretical/statistical reason the requested marginal effects cannot be estimated? Are these effects not properly defined in this case? Am I missing crucial conceptual issues here?
Or is this result merely a 'technical' problem?
Any thoughts?
Your time is appreciated.
Daniel
I am using Stata 12.1, fully updated, on a Windows 7 32Bit machine.
I am running a linear fixed-effects (within) regression model including an interaction between one variable that is constant within panels and one variable that varies within panels.
I want to inspect this interaction graphically and therefore want to obtain adjusted predictions using the margins command. However, Stata seems to be unable to estimate what I want. Here is an illustrating example:
Code:
webuse nlswork ,clear xtset idcode year xtreg ln_wage c.hours##i.collgrad ,fe margins collgrad ,at(hours = (20(10)60))
Code:
. xtreg ln_wage c.hours##i.collgrad ,fe note: 1.collgrad omitted because of collinearity Fixed-effects (within) regression Number of obs = 28467 Group variable: idcode Number of groups = 4710 R-sq: within = 0.0011 Obs per group: min = 1 between = 0.1868 avg = 6.0 overall = 0.1034 max = 15 F(2,23755) = 13.05 corr(u_i, Xb) = -0.4978 Prob > F = 0.0000 ---------------------------------------------------------------------------------- ln_wage | Coef. Std. Err. t P>|t| [95% Conf. Interval] -----------------+---------------------------------------------------------------- hours | .0010481 .0002818 3.72 0.000 .0004957 .0016004 1.collgrad | 0 (omitted) | collgrad#c.hours | 1 | -.0030347 .0006335 -4.79 0.000 -.0042764 -.0017931 | _cons | 1.65641 .0094353 175.55 0.000 1.637916 1.674904 -----------------+---------------------------------------------------------------- sigma_u | .44574269 sigma_e | .32025546 rho | .65954017 (fraction of variance due to u_i) ---------------------------------------------------------------------------------- F test that all u_i=0: F(4709, 23755) = 6.91 Prob > F = 0.0000 . . margins collgrad ,at(hours = (20(10)60)) Adjusted predictions Number of obs = 28467 Model VCE : Conventional Expression : Linear prediction, predict() 1._at : hours = 20 2._at : hours = 30 3._at : hours = 40 4._at : hours = 50 5._at : hours = 60 ------------------------------------------------------------------------------ | Delta-method | Margin Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- _at#collgrad | 1 0 | . (not estimable) 1 1 | . (not estimable) 2 0 | . (not estimable) 2 1 | . (not estimable) 3 0 | . (not estimable) 3 1 | . (not estimable) 4 0 | . (not estimable) 4 1 | . (not estimable) 5 0 | . (not estimable) 5 1 | . (not estimable) ------------------------------------------------------------------------------
Or is this result merely a 'technical' problem?
Any thoughts?
Your time is appreciated.
Daniel
I am using Stata 12.1, fully updated, on a Windows 7 32Bit machine.
Comment