[R] the survey package

Thomas Lumley tlumley at u.washington.edu
Mon Sep 10 17:43:22 CEST 2007


On Thu, 6 Sep 2007, Tobias Verbeke wrote:

> eugen pircalabelu wrote:
>
>>   I'm trying to use the survey package to get a better point of view 
>> for my data, but i need some piece of advice:
>>
>>   i have some data from a survey which has been stratified using 2 
>> criteria: region(7 values), size of locality(5 values)  Using the 
>> survey pakage how can i define in a correct way this design (taking 
>> into account all 4 strata not just one as in the Survey example)
>>
<snip>
> According to ?svydesign, strata is a formula.
>
> The following should work (untested):
>
> design <- svydesign(ids=~0, strata=~regiune + size_loc, data=tabel)

This would be a two-stage sample, you actually need ~interaction(regiune, 
size_loc).

[this reply is just to make sure it ends up linked in the archives].

 	-thomas



More information about the R-help mailing list