不爱读书的呆呆 发表于 2020-8-14 22:57 
我执行一遍也是这样的,但执行自己的代码(nbreg)之后的结果就又有重复列了。
. webuse rod93
. generate logexp=ln(exposure)
.
. nbreg deaths i.cohort, exposure(exp)
Fitting Poisson model:
Iteration 0: log likelihood = -2160.0542
Iteration 1: log likelihood = -2159.516
Iteration 2: log likelihood = -2159.5158
Iteration 3: log likelihood = -2159.5158
Fitting constant-only model:
Iteration 0: log likelihood = -187.06699
Iteration 1: log likelihood = -151.29069
Iteration 2: log likelihood = -131.82867
Iteration 3: log likelihood = -131.58459
Iteration 4: log likelihood = -131.58186
Iteration 5: log likelihood = -131.58186
Fitting full model:
Iteration 0: log likelihood = -131.58186
Iteration 1: log likelihood = -131.38447
Iteration 2: log likelihood = -131.3799
Iteration 3: log likelihood = -131.3799
Negative binomial regression Number of obs = 21
LR chi2(2) = 0.40
Dispersion = mean Prob > chi2 = 0.8171
Log likelihood = -131.3799 Pseudo R2 = 0.0015
------------------------------------------------------------------------------
deaths | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
cohort |
1960-1967 | -.2676187 .7237203 -0.37 0.712 -1.686085 1.150847
1968-1976 | -.4573957 .7236651 -0.63 0.527 -1.875753 .9609618
|
_cons | -2.086731 .5118559 -4.08 0.000 -3.08995 -1.083511
ln(exposure) | 1 (exposure)
-------------+----------------------------------------------------------------
/lnalpha | .5939963 .2583615 .087617 1.100376
-------------+----------------------------------------------------------------
alpha | 1.811212 .4679475 1.09157 3.005294
------------------------------------------------------------------------------
LR test of alpha=0: chibar2(01) = 4056.27 Prob >= chibar2 = 0.000
. outreg2 using c:\temp\data.doc,replace
c:\temp\data.doc
dir : seeout
(1) (2)
VARIABLES deaths /
2.cohort -0.268
(0.724)
3.cohort -0.457
(0.724)
lnalpha 0.594**
(0.258)
Constant -2.087***
(0.512)
Observations 21 21
Standard errors in parentheses
*** p<0.01, ** p<0.05, * p<0.1