Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: CIs from survey commands


From   [email protected] (Jeff Pitblado, StataCorp LP)
To   [email protected]
Subject   Re: st: CIs from survey commands
Date   Wed, 25 Jan 2006 09:58:04 -0600

Richard Palmer-Jones <[email protected]> asks

> How do I recover the CIs from svymean?
> Using (for example)
> 
> svymean s
> mat no = e(_N)
> di ci = _b[s] +/- invttail(-1,0.025)* _se[s]
> 
> does not give exatly the same figures as reported by the output

Richard has most of the formula correct, except for the degrees of freedom.
-svymean- (and -svy: mean- in Stata 9) save the degrees of freedom in
-e(df_r)-.  To reproduce the CIs reported by -svymean-, type

	. svymean s
	. di "95% lower limit = " _b[s] - invttail(e(df_r), 0.025) * _se[s]
	. di "95% upper limit = " _b[s] + invttail(e(df_r), 0.025) * _se[s]

--Jeff
[email protected]
*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index