I have run into a problem trying to replicate some code from Stata 16 in Stata 15. Do you have any idea of what might be going on? I read the update notes and could not identify why this is happening.
Here you have the code that works in Stata 16.
Code:
. * Using Stata SE 16.1
.
. sysuse auto.dta, clear
(1978 Automobile Data)
.
. recode rep78 (2=1) (3/5=0)
(rep78: 67 changes made)
.
. probit rep78 mpg headroom
Iteration 0: log likelihood = -28.552789
Iteration 1: log likelihood = -27.844339
Iteration 2: log likelihood = -27.837343
Iteration 3: log likelihood = -27.837342
Probit regression Number of obs = 69
LR chi2(2) = 1.43
Prob > chi2 = 0.4890
Log likelihood = -27.837342 Pseudo R2 = 0.0251
------------------------------------------------------------------------------
rep78 | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
mpg | -.0482431 .043335 -1.11 0.266 -.1331782 .036692
headroom | -.0784669 .2285802 -0.34 0.731 -.5264758 .369542
_cons | .168579 1.340746 0.13 0.900 -2.459235 2.796393
------------------------------------------------------------------------------
.
. local c2_apath_coef = round(r(table)[1,1], .01)
.
. di `c2_apath_coef'
-.05
.
end of do-fileCode:
. * Using Stata SE 15.1
.
. sysuse auto.dta, clear
(1978 Automobile Data)
.
. recode rep78 (2=1) (3/5=0)
(rep78: 67 changes made)
.
. probit rep78 mpg headroom
Iteration 0: log likelihood = -28.552789
Iteration 1: log likelihood = -27.844339
Iteration 2: log likelihood = -27.837343
Iteration 3: log likelihood = -27.837342
Probit regression Number of obs = 69
LR chi2(2) = 1.43
Prob > chi2 = 0.4890
Log likelihood = -27.837342 Pseudo R2 = 0.0251
------------------------------------------------------------------------------
rep78 | Coef. Std. Err. z P>|z| [95% Conf. Interval]
-------------+----------------------------------------------------------------
mpg | -.0482431 .043335 -1.11 0.266 -.1331782 .036692
headroom | -.0784669 .2285802 -0.34 0.731 -.5264758 .369542
_cons | .168579 1.340746 0.13 0.900 -2.459235 2.796393
------------------------------------------------------------------------------
.
. local c2_apath_coef = r(table)[1,1], .01)
invalid syntax
r(198);
0 Response to Unable to replicate Stata 16 code local x = r(table)[1,1] in Stata 15
Post a Comment