model {mme} | R Documentation |
Choose between the three models
Description
This function chooses one of the three models.
Usage
model(d, t, pp, Xk, X, Z, initial, y, M, MM, mod)
Arguments
d |
number of areas. |
t |
number of time periods. |
pp |
vector with the number of the auxiliary variables per category. |
Xk |
list of matrices with the auxiliary variables per category obtained from |
X |
list of matrices with the auxiliary variables obtained from |
Z |
design matrix of random effects obtained from |
initial |
output of the function |
y |
matrix with the response variable obtained from |
M |
vector with the area sample sizes. |
MM |
vector with the population sample sizes. |
mod |
a number specifying the type of models: 1=multinomial mixed model with one independent random effect in each category of the response variable (Model 1), 2=multinomial mixed model with two independent random effects in each category of the response variable: one domain random effect and another independent time and domain random effect (Model 2) and 3= multinomial model with two independent random effects in each category of the response variable: one domain random effect and another correlated time and domain random effect (Model 3). |
Value
the output of the function modelfit1
, modelfit2
or modelfit3
.
References
Lopez-Vizcaino, ME, Lombardia, MJ and Morales, D (2013). Multinomial-based small area estimation of labour force indicators. Statistical Modelling, 13 ,153-178.
Lopez-Vizcaino, ME, Lombardia, MJ and Morales, D (2013). Small area estimation of labour force indicator under a multinomial mixed model with correlated time and area effects. Submitted for review.
Examples
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 #Model 1
datar=data.mme(simdata,k,pp,mod)
result=model(datar$d,datar$t,pp,datar$Xk,datar$X,datar$Z,datar$initial,datar$y[,1:(k-1)],
datar$n,datar$N, mod)