# Load example data
data(data_s);data(univ)
# \donttest{
tot<-aggregate(tot~dom+pro,univ,sum)
# One random effect at domain level
formula<-as.formula(cbind(emp,unemp,inact)~(1|mun)+
factor(sexage)+factor(edu)+factor(fore))
# Drop from the universe data frame variables not referenced in the formula or in the broadarea
univ_1<-univ[,-6]
# Estimate mind model benchmarking the unemployment variable
example.1<-mind.unit(formula=formula,dom="dom",data=data_s,universe=univ_1,MSE=FALSE)
SAEest<-example.1$EBLUP[,c(1,3)]
SAEest<-merge(SAEest,tot)
SAEest$unemp<-SAEest$unemp/SAEest$tot
bench<-data.frame(pro=c(10,11),bb=c(0.27,0.31))
# Benchmark the unemployment point estimates
SAEest_bench<-benchSAE(estim_sae=SAEest,
benchmark_area=bench,
area="pro",
name_dom="dom",
estimator="unemp",
Nest="tot")
# }
Run the code above in your browser using DataLab