-3

I trained my model on 6000 training sample (glm) Then, I tried predict for vector with 200000 rows, But as a result I received only 6000 rows.

I used these arguments for the function predict():

     predict(                       
object = model_ppp2,
newdate = Model_education, 
type = c("link", "response", "terms"),
se.fit = TRUE, 
dispersion = NULL, 
terms = NULL,
na.action = na.pass
)

Thanks

Marianna
  • 1
  • 1
  • 3
    You probably need to provide more details, for example your codes. Now what I could guess is that you didn't specify the arguments `newdata = ` in your `predict()` function. If you didn't define `newdata`, it will do an in sample predict. – TooYoung Mar 31 '17 at 14:45
  • It really would have just made a lot more sense to post the actual command you used. – Dason Mar 31 '17 at 15:02
  • 2
    `newdata=` not `newdate=` – Julian Wittische Mar 31 '17 at 15:14
  • Thank you, but I define "newdata=" already: predict( object = model_ppp2, newdate = Model_education, type = c("link", "response", "terms"), se.fit = TRUE, dispersion = NULL, terms = NULL, na.action = na.pass ) – Marianna Mar 31 '17 at 15:17
  • 1
    Please provide us with a [reproducible example](http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example). I also invite you to learn [how to ask a good question](https://stackoverflow.com/help/how-to-ask) on this site. – Julian Wittische Mar 31 '17 at 15:21

1 Answers1

1

The code should be

predict(                       
 object = model_ppp2,
 newdata = Model_education, 
 type = c("link", "response", "terms"),
 se.fit = TRUE, 
 dispersion = NULL, 
 terms = NULL,
 na.action = na.pass
)

so newdatA instead of newdatE

CAFEBABE
  • 3,983
  • 1
  • 19
  • 38