# NOT RUN {
##load dataset
data(datamsaeDB)
#Compute Fitted model for Y1, Y2, and Y3
#Y1 ~ X1 + X2
#Y2 ~ X2
#Y3 ~ X1
##Using parameter 'data'
formula = list(f1 = Y1~X1+X2,
f2 = Y2~X2,
f3 = Y3~X1)
vardir = c("v1","v12","v13","v2","v23","v3")
weight = c("w1","w2","w3")
msaeDB <- msaedb(formula, vardir, weight, data=datamsaeDB)
##Do not use parameter 'data'
formula = list(f1 = datamsaeDB$Y1~datamsaeDB$X1+datamsaeDB$X2,
f2 = datamsaeDB$Y2~datamsaeDB$X2,
f3 = datamsaeDB$Y3~datamsaeDB$X1)
vardir = datamsaeDB[,c("v1","v12","v13","v2","v23","v3")]
weight = datamsaeDB[,c("w1","w2","w3")]
msaeDB_d <- msaedb(formula, vardir, weight)
msaeDB$MSAE_Eblup #to see EBLUP Estimators
msaeDB$MSE_Eblup #to see estimated MSE of EBLUP estimators
msaeDB$difference_benchmarking$Estimation #to see Benchmarked EBLUP Estimators
msaeDB$difference_benchmarking$MSE_DB #to see estimated MSE of Benchmarked EBLUP Estimators
msaeDB$difference_benchmarking$Aggregation #to see the aggregation of, benchmarking.
# }
Run the code above in your browser using DataLab