fpc.Rd
The fpc
data frame has 8 rows and 6 columns. It is artificial
data to illustrate survey sampling estimators.
data(fpc)
This data frame contains the following columns:
Stratum ids
Sampling unit ids
Sampling weights
number sampled per stratum
population size per stratum
data
data(fpc)
fpc
#> stratid psuid weight nh Nh x
#> 1 1 1 3 5 15 2.8
#> 2 1 2 3 5 15 4.1
#> 3 1 3 3 5 15 6.8
#> 4 1 4 3 5 15 6.8
#> 5 1 5 3 5 15 9.2
#> 6 2 1 4 3 12 3.7
#> 7 2 2 4 3 12 6.6
#> 8 2 3 4 3 12 4.2
withoutfpc<-svydesign(weights=~weight, ids=~psuid, strata=~stratid, variables=~x,
data=fpc, nest=TRUE)
withoutfpc
#> Stratified Independent Sampling design (with replacement)
#> svydesign(weights = ~weight, ids = ~psuid, strata = ~stratid,
#> variables = ~x, data = fpc, nest = TRUE)
svymean(~x, withoutfpc)
#> mean SE
#> x 5.4481 0.7413
withfpc<-svydesign(weights=~weight, ids=~psuid, strata=~stratid,
fpc=~Nh, variables=~x, data=fpc, nest=TRUE)
withfpc
#> Stratified Independent Sampling design
#> svydesign(weights = ~weight, ids = ~psuid, strata = ~stratid,
#> fpc = ~Nh, variables = ~x, data = fpc, nest = TRUE)
svymean(~x, withfpc)
#> mean SE
#> x 5.4481 0.616
## Other equivalent forms
withfpc<-svydesign(prob=~I(1/weight), ids=~psuid, strata=~stratid,
fpc=~Nh, variables=~x, data=fpc, nest=TRUE)
svymean(~x, withfpc)
#> mean SE
#> x 5.4481 0.616
withfpc<-svydesign(weights=~weight, ids=~psuid, strata=~stratid,
fpc=~I(nh/Nh), variables=~x, data=fpc, nest=TRUE)
svymean(~x, withfpc)
#> mean SE
#> x 5.4481 0.616
withfpc<-svydesign(weights=~weight, ids=~interaction(stratid,psuid),
strata=~stratid, fpc=~I(nh/Nh), variables=~x, data=fpc)
svymean(~x, withfpc)
#> mean SE
#> x 5.4481 0.616
withfpc<-svydesign(ids=~psuid, strata=~stratid, fpc=~Nh,
variables=~x,data=fpc,nest=TRUE)
svymean(~x, withfpc)
#> mean SE
#> x 5.4481 0.616
withfpc<-svydesign(ids=~psuid, strata=~stratid,
fpc=~I(nh/Nh), variables=~x, data=fpc, nest=TRUE)
svymean(~x, withfpc)
#> mean SE
#> x 5.4481 0.616