Model variance-covariance matrix of the multinomial mixed models
Model variance-covariance matrix of the multinomial mixed models
This function calculates the variance-covariance matrix of the multinomial mixed models. Three types of multinomial mixed model are considered. The first model (Model 1), with one random effect in each category of the response variable; Model 2, introducing independent time effect; Model 3, introducing correlated time effect.
wmatrix(M, pr)
Arguments
M: vector with area sample sizes.
pr: matrix with the estimated probabilities for the categories of the response variable obtained from prmu or prmu.time.
Returns
W a list with the model variance-covariance matrices for each domain.
Examples
k=3#number of categories of the response variablepp=c(1,1)#vector with the number of auxiliary variables in each categorymod=2#type of modeldata(simdata2)datar=data.mme(simdata2,k,pp,mod)initial=datar$initial
mean=prmu.time(datar$n,datar$Xk,initial$beta.0,initial$u1.0,initial$u2.0)##The model variance-covariance matrixvarcov=wmatrix(datar$n,mean$estimated.probabilities)
References
Lopez-Vizcaino, ME, Lombardia, MJ and Morales, D (2013). Multinomial-based small area estimation of labour force indicators. Statistical Modelling,13,153-178.