# NOT RUN {
#This example use the data set 'apipop' of the survey package.
library(sregsurvey)
library(survey)
library(magrittr)
library(dplyr)
library(gamlss)
data(api)
attach(apipop)
Apipop <- filter(apipop,full!= 'NA')
Apipop <- filter(Apipop, stype == 'H')
Apipop <- Apipop %>% dplyr::select(api00,grad.sch,full)
sreg_ber(api00 ~ pb(grad.sch), scale_formula = ~ full - 1, data= Apipop, pi=0.25)
# The total population value is
sum(Apipop$api00)
# }
Run the code above in your browser using DataLab