On Thu, 6 Sep 2007, eugen pircalabelu wrote:

> Good afternoon!
>
>  I'm trying to use the Survey package for a stratified sample which has 
> 4 criteria on which the stratification is based. I would like to get the 
> corrected weights and for every element i get a weight of 1
>
>  E.g: tipping
>
>   design <- svydesign (id=~1, strata= ~regiune + size_loc + age_rec_hhh 
> + size_hh, data= tabel)
>   and then      weights(design)
>  gives me:  1,1,1,1,1,1,1,1,1,1,1,........... for each element
>

There are two problems.  The first is that you have the wrong syntax for 
strata.  If you have one stage of sampling with multiple stratifying 
factors you need to create a single factor representing the strata. One 
way is with interaction()

design <- svydesign (id=~1, strata= ~interaction(regiune, size_loc,  
age_rec_hhh, size_hh), data= tabel)

Second, you have not specified either weights or population sizes, so R 
has no way to work out the sampling weights. That's why you get weights of 
1.  You should also get a warning.

        -thomas

______________________________________________
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
and provide commented, minimal, self-contained, reproducible code.

Reply via email to