0

I am trying to understand what the predicted values represent in the predict function in nlme

I am using the data and code given in the nlme manual for the predict function as an example

library(nlme)
fm1 <- lme(distance ~ age, Orthodont, random = ~ age | Subject)
    newOrth <- data.frame(Sex = c("Female","Female","Female","Female","Male","Male"),
                          age = c(15, 20, 10, 12, 2, 4),
                          Subject = c("M01","M01","F30","F30","M04","M04"))
    ## The  Orthodont  data has *no*  F30 , so predict  NA  at level 1 :
    predict(fm1, newOrth, level = 0:1)

What is the difference between the predict.fixed and predict.Subject column?

I gather that if we leave out the levels argument we get the predicted value, at each requested value of age, for each subject, and that this is the 0 in the 0:1 of the levels argument. But what is predict.fixed and how is it useful?

llewmills
  • 2,959
  • 3
  • 31
  • 58
  • 1
    By default you get *conditional* predictions, specific to each Subject. The level-0 predictions, as explained in the documentation, are the population or *marginal* predictions. These are the predictions for the "average" subject in the population sampled. If we want to make population-level inference, rather than to these specific subjects, we use the level-0 predictions. – aosmith Sep 09 '16 at 13:38
  • 1
    The discussion of conditional vs marginal predictions may be better suited for [Cross Validated](http://stats.stackexchange.com/). See, for example, [here](http://stats.stackexchange.com/questions/86309/marginal-model-versus-random-effects-model-how-to-choose-between-them-an-advi) – aosmith Sep 09 '16 at 13:39
  • Thank you @aosmith, yes I guess it is veering into CV territory. I am still confused though. Firstly the answer in link you provided states that the estimates of marginal and conditional models coincide, yet the estimates in the two columns - `predict.fixed` and `predict.ID` - for each individual are different. Secondly if the estimates are for the average subject, why are they all different? i.e. in what sense are they average? – llewmills Sep 12 '16 at 07:25
  • 1
    Your questions now really sound like statistics questions. If you don't want to move the question, [keep reading](http://stats.stackexchange.com/questions/59137/subject-specific-vs-population-average-predictions/68531#68531) on population-level and subject-level predictions and it should become clear how one type is the effect for the "average" subject (so random effects are 0) and one type adds in the "subject" effect. – aosmith Sep 12 '16 at 14:13
  • thank you once again @aosmith I am starting to get a sense of it. I will ask the question on CV as I am still not clear on how 'holding the random effects constant' (in the case of subject-specific) differs from 'averaging across random effects' (in the case of the population-level estimates) – llewmills Sep 12 '16 at 16:51

0 Answers0