crowd.Rd
A tiny dataset from the VPLX manual.
data(crowd)
A data frame with 6 observations on the following 5 variables.
Number of rooms in the house
Number of people in the household
Sampling weight
Cluster number
Stratum number
Manual for VPLX, Census Bureau.
data(crowd)
## Example 1-1
i1.1<-as.svrepdesign(svydesign(id=~cluster, weight=~weight,data=crowd))
i1.1<-update(i1.1, room.ratio=rooms/person,
overcrowded=factor(person>rooms))
svymean(~rooms+person+room.ratio,i1.1)
#> mean SE
#> rooms 6.0000 0.6831
#> person 4.0000 1.1832
#> room.ratio 2.3274 0.6006
svytotal(~rooms+person+room.ratio,i1.1)
#> total SE
#> rooms 36.000 4.0988
#> person 24.000 7.0993
#> room.ratio 13.964 3.6037
svymean(~rooms+person+room.ratio,subset(i1.1,overcrowded==TRUE))
#> mean SE
#> rooms 5.50000 0.6455
#> person 7.50000 0.6455
#> room.ratio 0.73214 0.0231
svytotal(~rooms+person+room.ratio,subset(i1.1,overcrowded==TRUE))
#> total SE
#> rooms 11.0000 7.0000
#> person 15.0000 9.5184
#> room.ratio 1.4643 0.9265
## Example 1-2
i1.2<-as.svrepdesign(svydesign(id=~cluster,weight=~weight,strata=~stratum, data=crowd))
svymean(~rooms+person,i1.2)
#> mean SE
#> rooms 6 0.2357
#> person 4 0.4082
svytotal(~rooms+person,i1.2)
#> total SE
#> rooms 36 1.4142
#> person 24 2.4495