This function calculates the analytic MSE for the multinomial mixed model with one independent random effect per category of the response variable (Model 1). See Lopez-Vizcaino et al. (2013), section 4, for details. The formulas of Prasad and Rao (1990) are adapted to Model 1. This function uses the output of modelfit1.
msef(pp, X, Z, resul, MM, M)
Arguments
resul: the output of the function modelfit1.
X: list of matrices with the auxiliary variables obtained from data.mme. The dimension of the list is the number of categories of the response variable minus one.
Z: design matrix of random effects obtained from data.mme.
pp: vector with the number of the auxiliary variables per category.
M: vector with the area sample sizes.
MM: vector with the population sample sizes.
Returns
mse is a matrix with the MSE estimator calculated by adapting the explicit formulas of Prasad and Rao (1990).
Examples
require(Matrix)k=3#number of categories of the response variablepp=c(1,1)#vector with the number of auxiliary variables in each categorydata(simdata)#datamod=1# type of modeldatar=data.mme(simdata,k,pp,mod)# Model fitresult=modelfit1(pp,datar$Xk,datar$X,datar$Z,datar$initial,datar$y[,1:(k-1)], datar$n,datar$N)#Analytic MSEmse=msef(pp,datar$X,datar$Z,result,datar$N,datar$n)
References
Lopez-Vizcaino, ME, Lombardia, MJ and Morales, D (2013). Multinomial-based small area estimation of labour force indicators. Statistical Modelling, 13, 153-178.
Prasad, NGN, Rao, JNK (1990).The estimation of the mean squared error of small area estimators. Journal of the American Statistical Association, 85, 163-171.