Skip to content
Prev 39269 / 398500 Next

predict for a model with a subset

example(predict.glm)
fit <- glm(SF ~ ldose, family=binomial, subset=sex=="M")
predict(fit)
[1] -2.8185550 -1.5596055 -0.3006561  0.9582933  2.2172427  3.4761922

which is just the males.

So, that example works correctly, and predict.glm as called by you should 
just return the fitted values, as above.
On Fri, 24 Oct 2003, Peter Flom wrote:

            
Perhaps you can show us how you managed to break it?