[R-sig-ME] How to calculate predictions

Stuart Luppescu slu at ccsr.uchicago.edu
Tue Feb 28 00:31:04 CET 2012


On Mon, 2012-02-27 at 16:07 -0700, Jake Westfall wrote:
> Unless I am misunderstanding what you're after, one thing you can do
> is just append the fitted values to the data frame (you will want to
> use math.lme3 at frame in case of dropped observations) and from there
> pick out the predicted value for each student at age 15. All of the
> appropriate other effects should be factored in.

I believe that fitted() is giving fitted values for each observation. 

 length(fitted(math.lme3))
[1] 520573
 length(unique(math.lme3 at frame$sid))
[1] 236994

I have about 520,000 observations nested within 236,994 students. I want
a fitted value for each student at age 15 (which may or may not be
actually observed).
-- 
Stuart Luppescu -=- slu .at. ccsr.uchicago.edu        
University of Chicago -=- CCSR 
才文と智奈美の父 -=-    Kernel 3.2.1-gentoo-r2                
1st mail: One of the reasons that SAM is popular,
 is that it is popular (i.e. since everyone has
 heard of it, it makes reviewers happy). So, it
 would be nice to be able to point to publications 
 in good journals so that reviewers will be
 comfortable. (I personally, am quite comfortable
 with SAM). 2nd mail: Oops, must have been a
 Freudian slip. Actually, I am not perfectly
 comfortable with SAM. But I am quite comfortable




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