Dear List,

I think I'm going crazy here...can anyone explain why do I get the same
predictions in train and test data sets below when the second has a missing
input?

y <- rnorm(1000)
x1 <- rnorm(1000)
x2 <- rnorm(1000)
train <- data.frame(y,x1,x2)
test <- data.frame(x1)

myfit <- glm(y ~ x1 + x2, data=train)
summary(myfit)
all(predict(myfit, test) == predict(myfit, train))

[1] TRUE



Thanks,

Axel.

        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to