modelfit1 {mme}R Documentation

Function used to fit Model 1

Description

This function fits the multinomial mixed model with one independent random effect per category of the response variable (Model 1), like in the formulation described in Lopez-Vizcaino et al. (2013). The fitting algorithm combines the penalized quasi-likelihood method (PQL) for estimating and predicting the fixed and random effects with the residual maximum likelihood method (REML) for estimating the variance components. This function uses as initial values the output of the function initial.values

Usage

modelfit1(pp, Xk, X, Z, initial, y, M, MM)

Arguments

pp

vector with the number of the auxiliary variables per category.

Xk

list of matrices with the auxiliary variables per category obtained from data.mme. The dimension of the list is the number of domains.

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.

initial

output of the function initial.values.

y

matrix with the response variable except the reference category obtained from data.mme. The rows are the domains and the columns are the categories of the response variable minus 1.

M

vector with the area sample sizes.

MM

vector with the population sample sizes.

Value

A list containing the following components.

Estimated.probabilities

matrix with the estimated probabilities for the categories of response variable.

Fisher.information.matrix.phi

Fisher information matrix of the random effect.

Fisher.information.matrix.beta

Fisher information matrix of the fixed effect.

u

matrix with the estimated random effects.

mean

matrix with the estimated mean of the response variable.

warning1

0=OK,1=The model could not be fitted.

warning2

0=OK,1=The value of the variance component is negative: the initial value is taken.

beta.Stddev.p.value

matrix with the estimated fixed effects, its standard deviations and its p-values.

phi.Stddev.p.value

matrix with the estimated variance components, its standard deviations and its p-values.

References

Lopez-Vizcaino, ME, Lombardia, MJ and Morales, D (2013). Multinomial-based small area estimation of labour force indicators. Statistical Modelling, 13, 153-178.

See Also

data.mme, initial.values, wmatrix, phi.mult, prmu, phi.direct, sPhikf, ci, Fbetaf, msef, mseb.

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 #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)

[Package mme version 0.1-6 Index]