Greetings,
I want to use outreg2 to report various logit model results including: AIC, BIC, log-likelihood for full model, chi-squared stat, Nagelkerke/C-U R-squared, and the percent predicted correctly. I am able to get most of these (except the percent predicted "correctly" using outreg2 using the following code:
Alternatively, I can get the percent predicted using this code:
I cannot, however, use fitstat and lstat without the return from one overwriting the other. So I tried the following to save the lstat results as a local macro and then run fitstat and then report both but I continue to get a "syntax error" (r198).
I am suspicious that fitstat is still over writing the local macro that I've written, but I am not sure. Any suggestions? Please give an example using code if possible as I am a novice with respect to matrix language and manipulation.
Kind regards and thanks.
I want to use outreg2 to report various logit model results including: AIC, BIC, log-likelihood for full model, chi-squared stat, Nagelkerke/C-U R-squared, and the percent predicted correctly. I am able to get most of these (except the percent predicted "correctly" using outreg2 using the following code:
Code:
logit y x1 x2 x3 , r est store M1, title (Model 1) fitstat outreg2 using Table.xls, dec(3) addstat(AIC, `r(stataaic)', BIC, `r(statabic)', Log-Likelihood Full Model, `r(ll)', chi-square test, `e(chi2)', Nagelkerke_R2, `r(r2_cu)') groupvar(x1 x2 x3) ctitle("Model 1") replace
Code:
logit y x1 x2 x3 , r est store M1, title (Model 1) lstat outreg2 using Table_IndependencePreferences.xls, dec(3) addstat(Percent Correct, `r(P_corr)') groupvar(x1 x2 x3) ctitle("Model 1") replace
Code:
logit y x1 x2 x3 , r est store M1, title (Model 1) lstat mat lstats = r(S) local PctCorr: display %4.1f lstats[1,9] fitstat outreg2 using Table_IndependencePreferences.xls, dec(3) addstat(AIC, `AIC', Pseudo R-squared, `e(r2_p)',chi-square test, `e(chi2)', PctCorr, `PctCorr') groupvar(x1 x2 x3) ctitle("Model 1") replace
Kind regards and thanks.
Comment