Hi all,
Iam getting a problem buildings tables with external value test (GOF) and etable using a loop.
I always get a remaining results of a last table, I can solve partially using: clear results, example ( I only expect 2 results):

With the same commands and If I dont include: clear results, repeat last table.

Iam getting a problem buildings tables with external value test (GOF) and etable using a loop.
I always get a remaining results of a last table, I can solve partially using: clear results, example ( I only expect 2 results):
Code:
webuse nhanes2l, clear
putdocx clear
putdocx begin
clear results
etable, column(index) mstat(chi2_gof=(r(chi2)), label(GOF χ²)) mstat(p_gof=(r(p)), label(GOF p-value) nformat(%6.4f)) showstars showstarsnote
forvalues i = 1/2 {
logit diabetes bpsystol age weight i.region if sex==`i'
estat gof
etable, append
}
putdocx collect
putdocx save test, replace
With the same commands and If I dont include: clear results, repeat last table.
Code:
webuse nhanes2l, clear
putdocx clear
putdocx begin
etable, column(index) mstat(chi2_gof=(r(chi2)), label(GOF χ²)) mstat(p_gof=(r(p)), label(GOF p-value) nformat(%6.4f)) showstars showstarsnote
forvalues i = 1/2 {
logit diabetes bpsystol age weight i.region if sex==`i'
estat gof
etable, append
}
putdocx collect
putdocx save test, replace

Comment