[R-sig-ME] mixed models with Fisk family
bbolker at gmail.com
Thu Dec 15 20:52:54 CET 2011
Alan Haynes <aghaynes at ...> writes:
> Dear list members,
> I was wondering whether anyone knows if it is possible to use the fisk
> distribution family with a mixed model?
"Is it possible" ... yes.
> I have found the family in the VGAM package and it seems possible to do a
> GLM using the vglm function in the same package. But this function doesnt
> seem to allow for random effects. I have tried it in lmer and it tells me
> that the family is not recognized
> Error in glmer(formula = CRR ~ trt + (1 | fence), data = experimental, :
> family '<S4 object of class structure("vglmff", package = "VGAM")>'
> not recognized
glmer hard-codes its family information for efficiency, so new
families are not possible unless you go to the (extreme) trouble of
downloading and hacking the source ... Furthermore, I believe the
Fisk/log-logistic is not in the exponential family, so it's not clear
that the resulting model would be a GLMM -- even if plugging in the
appropriate mean-variance relationship might work OK as a "quasi-likelihood"
approach. (Looking at the Wikipedia page on the log-logistic, it's
not even clear that the mean-variance relationship can be expressed
easily in closed form: looking at the W. page for the logistic, it
appears that the variance is independent of the mean, which further
suggests that a quasi-likelihood approach might not work well -- the
mean-variance relationship is the same as that of the Gaussian ...)
It should be possible to hack glmmADMB (or write an AD Model Builder
function from scratch) to fit these models, relatively easily. Possibly
easier (and more generalizable?) to code the likelihood function
for the logistic response and take the log of your data ...
Short answer: as far as I know, if you want to fit a model with
a 'custom' response (i.e. outside of the usual exponential family
choices), your choices are:
* hack something (glmmADMB is probably the easiest choice)
* use a more general tool, such as WinBUGS or AD Model Builder
* use PROC NLMIXED in SAS
* I don't know if Stata has a general-purpose tool. A quick skim
through the (2004) GLAMM manual suggests not.
More information about the R-sig-mixed-models