[R] predict.glm & newdata

From: Tom Guston <az12wsx_at_hotmail.com>
Date: Fri, 04 Apr 2008 13:28:47 -0400

Hi all -

I'm stumped by the following

mdl <- glm(resp ~ . , data = df, family=binomial, offset = ofst) WORKS yhat <- predict(mdl) WORKS
yhat <- predict(mdl,newdata = df) FAILS

Error in drop(X[, piv, drop = FALSE] %*% beta[piv]) :   subscript out of bounds

I've tried without offset, quoting binomial. The offset variable ofst IS in df.

Previous postings indicate possible names(df) problems (renaming factor levels?) but I'm using the same data.frame for the newdata option.

Thank you in advance for any pointers.

Tom.



Going green? See the top 12 foods to eat organic.

1N1653A

        [[alternative HTML version deleted]]



R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Fri 04 Apr 2008 - 17:35:17 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 04 Apr 2008 - 21:30:26 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive