# NOT RUN {
library(sregsurvey)
library(survey)
library(dplyr)
library(magrittr)
library(gamlss)
data(api)
attach(apipop)
Apipop <- filter(apipop,full!= 'NA')
Apipop <- Apipop %>% dplyr::select(api00,grad.sch,full,stype)
dim(Apipop)
sreg_stsi(api00 ~ pb(grad.sch),scale_formula = ~ full - 1, n=400, stratum = 'stype', data = Apipop)
# The total population value is
sum(Apipop$api00)
# }
Run the code above in your browser using DataLab