elciclopeturnio
2011-Jan-03 13:32 UTC
[R] Greetings. I have a question with mixed beta regression model in nlme.
*Dear R-help:
My name is Rodrigo and I have a question with nlme package
in R to fit a mixed beta regression model. The details of the model are:
Suppose that:*
*j in {1, ..., J}* *(level 1)*
*i in {1, ..., n_j}* *(level 2)*
*y_{ij} ~ Beta(mu_{ij} * phi_{ij}; (1 - mu_{ij}) * phi_{ij})
y_{ij} = mu_{ij} + w_{ij}
*
*with*
*logit(mu_{ij}) = Beta_{0i} + Beta_{1i} * x1_{ij} + b2 * x2_{ij}
log(phi_{ij}) = Gamma_{0i} + Gamma_{1i} * z1_{ij} + c2 * z2_{ij}
*
*Beta_{0i} = b_0 + u_{0i}
Beta_{1i} = b_1 + u_{1i}
Gamma_{0i} = c_0 + v_{0i}
Gamma_{1i} = c_1 + v_{1i}
*
*The vector* *(u_{0i}, u_{1i})'* *has normal distribution with mean*
*(0, 0)'* *and covariance matrix*
*sigma_{00} sigma_{01}
sigma_{10} sigma_{11}
*
*The vector* *(v_{0i}, v_{1i})'* *has normal distribution with mean*
*(0, 0)'* *and covariance matrix*
*delta_{00} delta_{01}
delta_{10} delta_{11}
*
*The* *w_{ij}s are independents. Each* *w_{ij}* *has mean* *0* *and variance
* *W*.
*The unknown parameters are:*
*
b_0, b_1, b_2, c_0, c_1, c_2, sigma_{00}, sigma_{10},
sigma_{11}, delta_{00}, delta_{10}, **and* *delta_{11}*.
*The question is:
How can I use nlme package in R to fit this model?
If you want to know additional information, send me a mail, please.
In advance, thanks a lot for your help.
Kind regards,
Rodrigo.*
[[alternative HTML version deleted]]
Ben Bolker
2011-Jan-03 20:01 UTC
[R] Greetings. I have a question with mixed beta regression model in nlme.
elciclopeturnio <elciclopeturnio <at> gmail.com> writes:> > *Dear R-help: > > My name is Rodrigo and I have a question with nlme package > in R to fit a mixed beta regression model. The details of the model are: >[snip]> *The question is: > How can I use nlme package in R to fit this model? > If you want to know additional information, send me a mail, please.nlme only fits models with normally distributed residual error (and normally distributed random effects). lmer (in the lme4) package fits models with exponential-family individual effects (i.e. GLMMs), but that doesn't include beta I don't know offhand of any package in R proper that will fit this model, although you could try Jim Lindsey's 'repeated' package <http://popgen.unimaas.nl/~jlindsey/rcode.html> or one of the HGLM packages. There are R interfaces to WinBUGS and AD Model Builder (possibly among others). good luck Ben Bolker