[R] Linear models (lme4) - basic question

Ben Bolker bbolker at gmail.com
Thu Sep 2 20:06:47 CEST 2010


James Nead <james_nead <at> yahoo.com> writes:

> 
> Sorry, forgot to mention that the processed data will be used as input for a 
> classification algorithm. So, I need to adjust for known effects before I can 
> use the data.
> 
> > I am trying to adjust raw data for both fixed and mixed effects. 
> The data that I
> > output should account for these effects, so that I can use 
> the adjusted data 
> >for
> > further analysis.
> >
> > For example, if I have the blood sugar levels for 30 patients, 
> and I know that
> > 'weight' is a fixed effect and that 'height' is a random effect, 
> what I'd want
> > as output is blood sugar levels that have been adjusted for these effects.

  What's not clear to me is what you mean by 'adjusted for'.
fitted(lm.adj) will give predicted values based on the height
and weight. I don't really know what the justification for/meaning
of the adjustment is, so I don't know whether you want to predict
on the basis of the heights, or whether you want to get a 'population-level'
prediction, i.e. one with height effects set to zero.  Maybe you want
residuals(lm.adj) ...?

  I suggest that follow-ups go to r-sig-mixed-models at r-project.org



More information about the R-help mailing list