Ryan de Vera
2014-Jun-06 14:03 UTC
[R] What is SE and how do you calculate it in svymean()?
Hello all, I have been experimenting with svymean() and I am confused on what the output is. The data I have looks like: *PSU* * STRATUM* * WEIGHTS* * COUNTS* *1* 1 1 2.0 1 *2* 2 1 1.0 1 *3* 3 1 1.0 1 *4* 3 1 2.5 1 *5* 2 1 1.0 1 *6* 2 1 1.0 1 *7* 1 1 2.0 1 *8* 1 1 3.0 2 I have this code:> q<-data.frame(PSU,STRATUM,WEIGHTS,COUNTS) > View(q) > dd<-svydesign(id=~PSU,strata=STRATUM, weights=~WEIGHTS, data=q,nest=TRUE) > svymean(~COUNTS,dd)mean SE COUNTS 1.2222 0.1607 I thought that SE was the standard error. When I tried to calculate it by hand I got something different. What is SE and how is it calculated? Thank you in advance! [[alternative HTML version deleted]]
Anthony Damico
2014-Jun-07 00:26 UTC
[R] What is SE and how do you calculate it in svymean()?
it is the survey design-adjusted standard error. you can view what's going on by typing `survey:::svymean.survey.design` and `survey:::svyCprod` :) On Fri, Jun 6, 2014 at 10:03 AM, Ryan de Vera <ryan.devera.03@gmail.com> wrote:> Hello all, > > I have been experimenting with svymean() and I am confused on what the > output is. The data I have looks like: > > > > *PSU* > > * STRATUM* > > * WEIGHTS* > > * COUNTS* > > *1* > > 1 > > 1 > > 2.0 > > 1 > > *2* > > 2 > > 1 > > 1.0 > > 1 > > *3* > > 3 > > 1 > > 1.0 > > 1 > > *4* > > 3 > > 1 > > 2.5 > > 1 > > *5* > > 2 > > 1 > > 1.0 > > 1 > > *6* > > 2 > > 1 > > 1.0 > > 1 > > *7* > > 1 > > 1 > > 2.0 > > 1 > > *8* > > 1 > > 1 > > 3.0 > > 2 > > I have this code: > > > q<-data.frame(PSU,STRATUM,WEIGHTS,COUNTS) > > View(q) > > dd<-svydesign(id=~PSU,strata=STRATUM, weights=~WEIGHTS, data=q,nest=TRUE) > > svymean(~COUNTS,dd) > > mean SE > COUNTS 1.2222 0.1607 > > I thought that SE was the standard error. When I tried to calculate it by > hand I got something different. What is SE and how is it calculated? Thank > you in advance! > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. >[[alternative HTML version deleted]]