[R-sig-ME] prediction with glmer

Phillip Alday phillip.alday at mpi.nl
Thu Feb 22 13:10:43 CET 2018


The fitted values include the random effects.

Phillip

On 22/02/18 12:57, Schlattmann, Peter wrote:
> Dear Philipp,
> 
> thank you so much.
> 
>> However, in your particular case, it's even easier: predict simply returns the fitted values.
> 
> Do these fitted values include the random effects or are they marginalized?
> 
> Thanks again
> 
> Peter
> 
> -----Ursprüngliche Nachricht-----
> Von: Phillip Alday [mailto:phillip.alday at mpi.nl]
> Gesendet: Donnerstag, 22. Februar 2018 12:32
> An: Schlattmann, Peter; r-sig-mixed-models at r-project.org
> Betreff: Re: [R-sig-ME] prediction with glmer
> 
> In terms of the random effects: it depends on the other arguments to
> predict() (in particular re.form) as to whether they are marginalized out or not (i.e. whether it's a pure fixed-effects prediction).
> 
> 
> My understanding is:
> If you only the same levels of your grouping variable occur in the new data as occurred in the old data (i.e. the data used to fit the model), then the conditional modes / BLUPs (BLUP is a bit of a misnomer in the GLMM case, and conditional mode is a fairly Bayesian perspective in a frequentist model) estimated for each level of the grouping variable (study_no in your case) are used.
> With new levels, predictions are made using the variance estimates and not the particular offsets / conditional modes / BLUPs.
> 
> However, in your particular case, it's even easier: predict simply returns the fitted values.
> 
> Phillip
> 
> 
> On 22/02/18 11:43, Schlattmann, Peter wrote:
>> Dear all,
>>
>> Apologies for a potential second post, I am not sure my first post came through.
>>
>>
>>
>> I am fitting a generalized linear mixed model with lme4 using glmer
>>
>>  with binomial errors and logit link. I am using the “predict”
>> function
>>
>>  to obtain predicted values for the current model and data set.
>>
>>
>>
>>  Here is some sample code
>>
>>
>>
>>  m.age50<-glmer(ct_pos~cath_pos+(1+cath_pos|study_no),data=test,
>> amily=binomial,na.action=na.omit)
>>
>>
>>
>>  result.age50<-predict(m.age50)
>>
>>
>>
>> My question is now: How exactly are the predictions calculated? I
>> could not find any details in the documentation.  Are these  just
>>
>>  based on the fixed effects setting the random effects to zero? Or are  these empirical Bayes estimates?
>>
>>
>>
>> Is there any documentation available?
>>
>>
>>
>>
>>
>> Thank  you very much in advance.
>>
>>
>>
>> Peter
>>
>>
>>
>> Universitätsklinikum Jena - Bachstrasse 18 - D-07743 Jena Die
>> gesetzlichen Pflichtangaben finden Sie unter
>> http://www.uniklinikum-jena.de/Pflichtangaben.html
>>
>>       [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> R-sig-mixed-models at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>>
> 
> Universitätsklinikum Jena - Bachstrasse 18 - D-07743 Jena
> Die gesetzlichen Pflichtangaben finden Sie unter http://www.uniklinikum-jena.de/Pflichtangaben.html
>



More information about the R-sig-mixed-models mailing list