Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: obtaining chi2 and p-values from crosstabs using estpost and esttab

From   Colleen Nugent <>
Subject   st: obtaining chi2 and p-values from crosstabs using estpost and esttab
Date   Mon, 12 Nov 2012 14:57:34 -0500 (EST)

I'm using complex survey data and subpopulations and am running some crosstabs.  I've been successful using estpost and esttab to output these results into Excel, but I am unable to get the chi2 and p-values to carry over into the spreadsheets.  Those cells are labeled but come out blank.  Chi2 and p-values are automatically produced in the output window itself as part of the svy command.  A simple version of my syntax looks like this:

estpost svy, subpop(subpopname): tabulate var1 var2, row percent obs
esttab using filename.csv, cells("b(f(2))" "obs") append unstack scalars(chi2 p)

I've tried throwing in estadd scalar chi2 and estadd chi2 = r(chi2), but those don't seem to help.
I've spent a long time sorting through help files for estpost, esttab, estadd, svy, and old Statalist threads and can't seem to find anything that addresses this.  Thanks for any tips that might help me.
*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index