On Tue, 23 May 2006, David L. Van Brunt, Ph.D. wrote:

> Just giving the survey package a spin...
>
> I'm accustomed to stata, and it seems very similar in many respects. One
> thing is throwing me, however.
>
> I've gotten my data in, and specified the design. Looks like the weighting
> is right (based on published population estimates from these data), but now
> I'd like to check my "marginal means" for proportions against those that
> have been published.

No, actually you get means with svymean().

Proportions for factor levels come by svymean() with a factor variable, 
eg:
> data(api)
> dclus1<-svydesign(id=~dnum, weights=~pw, data=apiclus1, fpc=~fpc)
> svymean(~stype,dclus1)
            mean     SE
stypeE 0.786885 0.0463
stypeH 0.076503 0.0268
stypeM 0.136612 0.0296
> svymean(~sch.wide,dclus1)
                mean     SE
sch.wideNo  0.12568 0.0204
sch.wideYes 0.87432 0.0204

        -thomas

Thomas Lumley                   Assoc. Professor, Biostatistics
[EMAIL PROTECTED]       University of Washington, Seattle

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to