[R] Problem with svyvar in survey package

Thomas Lumley tlumley at uw.edu
Tue Oct 25 17:16:26 CEST 2011


Yes, but you didn't answer the question: what version of the package
are you using?

   -thomas

On Tue, Oct 25, 2011 at 3:03 AM, amitava <amtv.statpresi at gmail.com> wrote:
> Respected Sir
>        Thanks for your reply.I am giving a part of my output to clarify my
> problem.
>
>
>
>
>> s=sample(N,n,replace=F)
>> print(s)
>  [1]  6 29 27 44 37 43  1 10 26 20
>> srswor_sample_data=getdata(salarydata,s)
>> attach(srswor_sample_data,warn.conflicts=F)
>> dsrswor=svydesign(id=~1,weights=rep((N/n),n),fpc=rep(N,n),data=srswor_sample_data)
>> print(dsrswor)
> Independent Sampling design
> svydesign(id = ~1, weights = rep((N/n), n), fpc = rep(N, n),
>    data = srswor_sample_data)
>> print(svyvar(~salary+yrsemp+priorex+educ+super,dsrswor))
>         variance         SE
> salary 7.1883e+07 2.5445e+07
> salary 1.1267e+04 4.8569e+03
> yrsemp 9.8333e+00 5.5376e+00
> educ   1.1267e+04 4.8569e+03
> super  3.2889e+00 1.4384e+00
>> print(svyvar(~salary+yrsemp+priorex,dsrswor))
>          variance         SE
> salary  7.1883e+07 2.5445e+07
> yrsemp  5.6732e+04 1.6373e+04
> priorex 9.8222e+00 3.9900e+00
>
>
>
> Above svyvar returns different results in two different situations(estimates
> of population variance of salary).
>
>
>
> --
> View this message in context: http://r.789695.n4.nabble.com/Problem-with-svyvar-in-survey-package-tp3932818p3936205.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org 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.
>



-- 
Thomas Lumley
Professor of Biostatistics
University of Auckland



More information about the R-help mailing list