[R] Problem with svyvar in survey package

amitava amtv.statpresi at gmail.com
Tue Oct 25 12:03:53 CEST 2011

Respected Sir
        Thanks for your reply.I am giving a part of my output to clarify my

> 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.

More information about the R-help mailing list