[R] the survey package

Tobias Verbeke tobias.verbeke at gmail.com
Thu Sep 6 14:30:29 CEST 2007


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) 
>    
>   i have tried 
>    
>   design<- svydesign(ids=~0, strata= c(~regiune,~size_loc), data=tabel) # for 2 criteria
>    
>   and got this error
>    
>   Error in strata[, 1] : incorrect number of dimensions
>   My "tabel" looks like this:

According to ?svydesign, strata is a formula.

The following should work (untested):

design <- svydesign(ids=~0, strata=~regiune + size_loc, data=tabel)

HTH,
Tobias

P.S. See http://faculty.washington.edu/tlumley/survey/
for all information relating to this package.

-- 

Tobias Verbeke - Consultant
Business & Decision Benelux
Rue de la révolution 8
1000 Brussels - BELGIUM

+32 499 36 33 15
tobias.verbeke at businessdecision.com



More information about the R-help mailing list