Description Usage Arguments Value References See Also Examples

This function calculates the variance components for the multinomial mixed model with two independent random effects
for each category of the response variable: one domain random effect and another independent time and domain random effect (Model 2). This variance components
are used in the second part of the fitting algorithm
implemented in `modelfit2`

. The algorithm adapts the ideas of Schall (1991) to a multivariate model. The variance components are
estimated by the REML method.

1 | ```
phi.direct.it(pp, sigmap, X, phi1, phi2, u1, u2)
``` |

`pp` |
vector with the number of auxiliary variables per category. |

`sigmap` |
a list with the model variance-covariance matrices for each domain obtained from |

`X` |
list of matrices with the auxiliary variables obtained from |

`phi1` |
vector with the initial values of the first variance component obtained from |

`phi2` |
vector with the initial values of the second variance component obtained from |

`u1` |
matrix with the values of the first random effect obtained from |

`u2` |
matrix with the values of the second random effect obtained from |

a list containing the following components.

`phi1.new` |
vector with the values of the variance component for the first random effect. |

`phi2.new` |
vector with the values of the variance component for the second random effect. |

Lopez-Vizcaino, ME, Lombardia, MJ and Morales, D (2013). Small area estimation of labour force indicators under a multinomial mixed model with correlated time and area effects. Submitted for review.

Schall, R (1991). Estimation in generalized linear models with random effects. Biometrika, 78,719-727.

`data.mme`

, `initial.values`

,
`wmatrix`

, `phi.mult.it`

,
`prmu.time`

, `Fbetaf.it`

`sPhikf.it`

, `ci`

,
`modelfit2`

, `msef.it`

,
`mseb`

1 2 3 4 5 6 7 8 9 10 11 12 13 | ```
k=3 #number of categories of the response variable
pp=c(1,1) #vector with the number of auxiliary variables in each category
d=10 #number of areas
mod=2 #Type of model
data(simdata2) #data
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)
sigmap=wmatrix(datar$n,mean$estimated.probabilities) #variance-covariance
## The variance components
phi.it=phi.direct.it(pp,sigmap,datar$X,initial$phi1.0,initial$phi2.0,
initial$u1.0,initial$u2.0)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.