[R] formula in fixed-effects part of GLMM

From: weihong <weihong_at_ualberta.ca>
Date: Sun 01 May 2005 - 03:31:14 EST


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

I am using R2.1.0, lme4 0.8-2, windows xp. Below is a dataset if you need (yr is a factor).

> dataset

   OVEN h h2 yr

1     2 30 900  0
2     3 30 900  1
3     4 30 900  2
4     3 30 900  3
5     3 30 900  4
6     1 25 625  0
7     2 25 625  1
8     1 25 625  2
9     1 25 625  3

10 2 25 625 4

Thanks ahead!

Weihong Li
Undergraduate student
University of Alberta



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 Sun May 01 03:35:19 2005

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