Re: [R] Complex Surveys...Specifying Design

From: Thomas Lumley <tlumley_at_u.washington.edu>
Date: Sun 25 Jul 2004 - 03:39:34 EST

On Fri, 23 Jul 2004, Tobias Verbeke wrote:

> I guess the most common way of proceeding is to first stratify,
> and then to sample clusters independently within each stratum.
> If this is the case, your data file can be put together like
>
> stratum psu ...
> 1 1
> 1 2
> 1 3
> 2 1
> 2 2
> 2 3
>
> or like
>
> stratum psu ...
> 1 1
> 1 2
> 1 3
> 2 4
> 2 5
> 2 6
>
> svydesign only likes the first data structure so

This is exactly backwards. svydesign by default assumes the *second* data structure.

>
> meps.design <- svydesign(ids = ~varpsu01, strata = ~varstr01,
> weights = ~perwt01f, nest = TRUE, data = h60)
>
> should work. See ?svydesign.

This fix is correct, even if the rationale is backwards.

        -thomas



R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sun Jul 25 03:52:37 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:55:13 EST