Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Using new values of random intercepts to predict values #418

Open
DikobrazDante opened this Issue May 15, 2017 · 1 comment

Comments

Projects
None yet
2 participants

Hello!

Let's say we have a following prediction:

mod <- y ~ x + (1+x | Subject)

Is there a way to predict new values in y, using the predict() function not by specifying only new fixed effects by using newdata arguement, but also by specifying a single random intercept value for which the predictions should be calculated?

According to my logic it should look something like this:
predict(mod, newdata = data.frame(x = seq(1,10, length.out=100), Subject$'(Intercept)' = 2)

Owner

bbolker commented Jun 5, 2017

Just trying to clarify: you want to substitute 2 for the conditional mode/BLUP for all subjects? Wouldn't this be equivalent to predict(mod, newdata= ..., re.form=NA) + 2? (re.form=NA sets all random effects to zero). If not, can you be more specific about what you want to do?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment