[R-sig-ME] Extracting Lv 1 and Lv 2 residuals: lmer

Ben Bolker bbo|ker @end|ng |rom gm@||@com
Mon Aug 19 21:10:06 CEST 2019




On 2019-08-19 2:36 p.m., Daniel P Moriarity wrote:
> Good afternoon,
> 
> I e-mailed one of the authors of the residuals function (see below) and
> they said that they could not remember but suggested e-mailing this mailing
> list. Any help would be appreciated!


  The URL below points to the help page for the lme function from the
nlme package - which is not the same as the lmer function in the lme4
package.

  individual-level residuals: residuals(model1)
  population-level residuals:  Data$Y - predict(model1, re.form=~0)


> 
> "I am attempting to extract the Lv 1 and Lv 2 from an lmer model using the
> below syntax, but no matter what I change the "level" to, the resulting
> objects are identical. Do either of you have the time to specify how to
> change this specifier to extract Lv1 and Lv2 residuals? Thank you.
> 
> model1 <- CRP_Dep_Model2 <-lmer(Y ~ X+C+(1|ID), data = Data)
> 
> residuals(model1, level = 0:1)
> 
> https://astrostatistics.psu.edu/su07/R/html/nlme/html/residuals.lme.html "
> 
> My best,
> Daniel
> 
> Doctoral Student, Clinical Area
> Mood and Cognition Lab
> Department of Psychology
> Temple University
> 1701 North 13th Street
> Philadelphia, PA 19122
> daniel.moriarity using temple.edu <hannah.frank using temple.edu>
> 
> *WARNING: This e-mail may contain material that is confidential and is for
> the sole use of the intended recipient.  If you are not the intended
> recipient, please contact the sender and delete all copies.  There are no
> guarantees that electronic communications are secure and protected.*
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-sig-mixed-models using r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>



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