mer is an adaptive M-estimator of the weighted mean or total. It is defined as the estimator that minimizes the estimated mean square error, mse, of the estimator under consideration.
head(losdata)library(survey)# Survey design for simple random sampling without replacementdn <-if(packageVersion("survey")>="4.2"){# survey design with pre-calibrated weights svydesign(ids =~1, fpc =~fpc, weights =~weight, data = losdata, calibrate.formula =~1)}else{# legacy mode svydesign(ids =~1, fpc =~fpc, weights =~weight, data = losdata)}# M-estimator of the total with tuning constant k = 8m <- svymean_huber(~los, dn, type ="rhj", k =8)# MER estimatormer(m)