using gee
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._