# NOT RUN {
# Loading data - population and sample data
data("eusilcA_popAgg")
data("eusilcA_smpAgg")
# Combine sample and population data
combined_data <- combine_data(pop_data = eusilcA_popAgg, pop_domains = "Domain",
smp_data = eusilcA_smpAgg, smp_domains = "Domain")
# Estimate Fay-Herriot model
fh_std <- fh(fixed = Mean ~ cash + self_empl, vardir = "Var_Mean",
combined_data = combined_data, domains = "Domain", method = "ml",
MSE = TRUE)
# Benchmark the point estimates
# Example 1: Receive data frame with point estimates and their benchmarked results
fh_bench <- benchmark(fh_std, benchmark = 20140.09,
share = eusilcA_popAgg$ratio_n, type = "ratio")
# Example 2: Add benchmarked results to fh object
fh_bench <- benchmark(fh_std, benchmark = 20140.09,
share = eusilcA_popAgg$ratio_n, type = "ratio", overwrite = TRUE)
# }
Run the code above in your browser using DataLab