0

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)
User33268
  • 159
  • 1
  • 11
  • Your request does not make sense to me. However, you can easily do a population-level prediction and add your "fixed random intercept" value to the predicted value. – Roland May 15 '17 at 10:36
  • The problem is that I don't know the slope for the new predict function if I only specify the fixed intercept. This is basically what I want to know - how to I get the value of the slope for the specifically set random intercept which was not observed. – User33268 May 15 '17 at 10:45
  • You can't predict for a subject that was not observed. You can only predict for subjects that were observed or for the population. – Roland May 15 '17 at 11:37
  • Ok, but then I suppose I can use the simulate() function, right? How would that work in my case? – User33268 May 15 '17 at 11:43

0 Answers0