[R] predict for a model with a subset

Peter Flom flom at ndri.org
Fri Oct 24 18:40:00 CEST 2003


Hello

running R 1.7.1 on Windows 2000

I have a model

notmar1 <- glm(yprisx~age+harddrug+sex, subset = marcom == 0,
 family = quasipoisson)

and summary(notmar1) gives (as it should) 433 df for the null model

but when I run
predict(notmar1 <- glm(yprisx~age+harddrug+sex, subset = marcom == 0, 
family = quasipoisson))

I get preditions for 528 people (the full data set, not the subset)

How do I get predict to work on just the subset of people for whom the
model is estimated?

Thanks

Peter




More information about the R-help mailing list