[R] using gee

Jun Yan jyan at stat.wisc.edu
Sat Apr 7 20:49:05 CEST 2001

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)

> 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.


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

More information about the R-help mailing list