Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | "Martin Weiss" <martin.weiss1@gmx.de> |
To | <statalist@hsphsun2.harvard.edu> |
Subject | RE: st: AW: confidence intervals, saved results, pweights |
Date | Sat, 17 Jul 2010 19:05:30 +0200 |
<> For the "manual" approach, also see Maarten`s http://www.stata-journal.com/article.html?article=st0137 HTH Martin -----Original Message----- From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Steve Samuels Sent: Samstag, 17. Juli 2010 18:49 To: statalist@hsphsun2.harvard.edu Subject: Re: st: AW: confidence intervals, saved results, pweights That's true of matrices e(b) and e(V) which are returned by every Stata estimation command, not just -svy- commands. It's irritating. You can: matrix list e(V) matrix v = e(V) di el(v,1,1) As to your first question, -parmest- is the best choice, as Martin pointed out, but you can do it from first principles. You also don't need to refer to the matrices, because Stata builds in _b[] and _se[] system variables. See the -help- for "system variables". ******************* sysuse auto, clear svyset _n svy: mean weight trunk matrix v =e(V) matrix list e(V) di sqrt(el(v,1,1)) di _se[weight] local bound_wt = _se[weight]*invttail(e(df_r),.025) gen llim_wt = _b[weight]-`bound_wt' gen ulim_wt = _b[weight]+`bound_wt' di llim " " ulim ********************* On Sat, Jul 17, 2010 at 11:29 AM, Martin Weiss <martin.weiss1@gmx.de> wrote: > > <> > > Try Roger`s -ssc d parmest-: > > > ************* > capture which parmest > if _rc ssc install parmest > > webuse fpc, clear > svyset [pw=weight] > svy: mean x > parmest, saving(myfile, replace) > > u myfile, clear > l > ************* > > > > HTH > Martin > > > -----Ursprüngliche Nachricht----- > Von: owner-statalist@hsphsun2.harvard.edu > [mailto:owner-statalist@hsphsun2.harvard.edu] Im Auftrag von Ben Zipperer > Gesendet: Samstag, 17. Juli 2010 17:24 > An: statalist@hsphsun2.harvard.edu > Betreff: st: confidence intervals, saved results, pweights > > confidence intervals of variable means in survey data with pweights. > > As I understand it, -svy: mean- will show the confidence interval, but > only returns the variance and mean in its e() results. Is it > recommended that I simply use these e() results to calculate my own > confidence interval (to match the one reported but not saved by -svy: > mean-), or is there a command like -ci- that saves as macros the > confidence interval results with pweighted survey data? > > Additionally, after -svy: mean- why can I display the elements of some > variance matrices but not others? For example, > > . webuse fpc, clear > > . svyset [pw=weight] > > pweight: weight > VCE: linearized > Single unit: missing > Strata 1: <one> > SU 1: <observations> > FPC 1: <zero> > > . svy: mean x > (running mean on estimation sample) > > Survey: Mean estimation > > Number of strata = 1 Number of obs = 8 > Number of PSUs = 8 Population size = 27 > Design df = 7 > > -------------------------------------------------------------- > | Linearized > | Mean Std. Err. [95% Conf. Interval] > -------------+------------------------------------------------ > x | 5.448148 .723725 3.73681 7.159486 > -------------------------------------------------------------- > > . di el(e(V_srs),1,1) > .54734078 > > . di el(e(V),1,1) > matrix operators that return matrices not allowed in this context > > thanks, > Ben > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/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/statalist/faq > * http://www.ats.ucla.edu/stat/stata/ > -- Steven Samuels sjsamuels@gmail.com 18 Cantine's Island Saugerties NY 12477 USA Voice: 845-246-0774 Fax: 206-202-4783 * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/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/statalist/faq * http://www.ats.ucla.edu/stat/stata/