Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st: RE: Putexcel with survey and tabulate command


From   "Cohen, Elan" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: RE: Putexcel with survey and tabulate command
Date   Mon, 31 Mar 2014 15:04:23 +0000

Anwar,

Here's a bit of code that might help.


webuse nhanes2b, clear
svyset psuid [pweight=finalwgt], strata(stratid)
svy: tabulate race , format(%11.3g) percent  missing 
mat pct = e(b)'
svy: tabulate race , format(%11.3g) count  se   missing
mat cnt = e(b)'
mat se = vecdiag(e(V))'
loc n = rowsof(se)
forv i=1/`n' {
	mat se[`i',1] = sqrt(el(se,`i',1))
}

Hope this helps,

- Elan


-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Dudekula, Anwar
Sent: Saturday, March 29, 2014 4:20
To: [email protected]
Subject: st: Putexcel with survey and tabulate command 

Hi Everyone, 

I wanted to ask the stata list members in this forum  regarding usage of putexcel  with tabulate  command in survey statistics. 

I would like to put the counts (and  standard errors) and percents in excel file with putexcel command. 

*************************************************************

webuse nhanes2b, clear
svyset psuid [pweight=finalwgt], strata(stratid)

svy: tabulate race , format(%11.3g) percent  missing 
svy: tabulate race , format(%11.3g) count  se   missing 

svy: tabulate race diabetes, missing count se

*****************************************************************

But I cant use the matcell and matrow option with tabulate in survey statistics.  I cant use coeflegend option either 

Does any one in this form has any ideas please . I very much appreciate your time and effort. 

Thank you, 
Yours Sincerely, 
Anwar 





*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index