Message-ID: <Pine.A41.4.33.0104081651420.64532-100000@homer32.u.washington.edu>
Date: 2001-04-08T23:53:35Z
From: Thomas Lumley
Subject: using gee
In-Reply-To: <Pine.LNX.3.96L.1010407133049.1855B-100000@gstat04.stat.wisc.edu>
On Sat, 7 Apr 2001, Jun Yan wrote:
> I have this trial function to use gee,
>
> trygee <- function (x, id) {
> y <- x + rnorm(length(x))
> dat <- data.frame(x=x, y=y, id=id)
> foo <- gee(y ~ x, id, data=dat)
> foo$coeffcients
> }
>
> > trygee(rnorm(100), id = 1:100)
> Error in model.frame.default(formula = y ~ x, id = id, data = dat) :
> Object "dat" not found
>
> Since I want to use gee within a function to be called again and again,
> what's the proper way to do this? Thanks.
It's a bug. Near the top of the gee() function there is the line
m<-eval(m,sys.parent())
This needs to be changed to
m<-eval(m,sys.frame(sys.parent()))
-thomas
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._