[R] predict for a model with a subset

Peter Flom
Fri, 24 Oct 2003 16:40:00 -0000

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