Description Usage Arguments Value References See Also Examples
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
.
1 | msef(pp, X, Z, resul, MM, M)
|
resul |
the output of the function |
X |
list of matrices with the auxiliary variables obtained from |
Z |
design matrix of random effects obtained from |
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. |
mse is a matrix with the MSE estimator calculated by adapting the explicit formulas of Prasad and Rao (1990).
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.
data.mme
, initial.values
,
wmatrix
, phi.mult
,
prmu
, phi.direct
,
sPhikf
, modelfit1
,
Fbetaf
, ci
,
mseb
.
1 2 3 4 5 6 7 8 9 10 11 12 13 | require(Matrix)
k=3 #number of categories of the response variable
pp=c(1,1) #vector with the number of auxiliary variables in each category
data(simdata) #data
mod=1 # type of model
datar=data.mme(simdata,k,pp,mod)
# Model fit
result=modelfit1(pp,datar$Xk,datar$X,datar$Z,datar$initial,datar$y[,1:(k-1)],
datar$n,datar$N)
#Analytic MSE
mse=msef(pp,datar$X,datar$Z,result,datar$N,datar$n)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.