demo/design.R

library('maSAE')
message('## load data')
data('s2')
message('## create object')
saeO  <- saObj(data = s2, f = y ~ NULL | g)
message('## design-based estimation for all small areas given by g')
predict(saeO)
message('## again, assuming the data are clustered:')
saeO  <- saObj(data = s2, f = y ~ NULL | g, cluster = 'clustid')
message('## as expected, the variances disregarding the clusters were deflated:')
predict(saeO)

Try the maSAE package in your browser

Any scripts or data that you put into this service are public.

maSAE documentation built on May 29, 2017, 9:28 p.m.