Re: [R] formula in fixed-effects part of GLMM

From: Douglas Bates <bates_at_stat.wisc.edu>
Date: Tue 03 May 2005 - 01:24:50 EST

weihong wrote:
> Can GLMM take formula derived from another object?
>
> foo <- glm (OVEN ~ h + h2, poisson, dataset)
>
> # ok
> bar <- GLMM (OVEN ~ h + h2, poisson, dataset, random = list (yr = ~1))
>
> #error
> bar <- GLMM (foo$formula, poisson, dataset, random = list (yr = ~1))
> #Error in foo$("formula" + yr + 1) : invalid subscript type

That won't work without some tweaking of the GLMM function. In the 0.95-1 and later versions of the lme4 package the capabilities of GLMM have been folded in to the lmer function and you would need to fit that model as

 lmer(OVEN ~ h + h2 + (1|yr), dataset, poisson)

anyway.



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Tue May 03 01:58:37 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:31:31 EST