This question might be a duplicate, but a colleague and I have trouble understanding previous answers about the use of weights in lme.

So in simple terms:

  • We have an experimental design with 2 different treatment on shrubs.
  • We want to analyze the mass (g) of the shrubs at the end of the experiment (year 5)
  • Shrubs varied in terms of initial mass at the beginning of the experiment (year 1)

The question:

Can we included the initial mass in our model to take into account that inital variation as this:

lme(mass ~ treatment1 + treatment2 + treatment1*treatment2, weights= ~ inital_mass)

2 Answers 2


Perhaps a better way to account for this variation is to include initial mass as a 'random' effect. This would be akin to looking at a weight loss drug and including initial weight as a random effect. This pairs each observation of weight with that study subjects initial weight. For instance, It may cause a weight loss of 10 lbs. So, subjects A B and C go from 300-> 290 lbs, 230-> 220 lbs, 190-> 180 lbs. Accounting for the initial weight gives you much more power to detect the 10lb effect than not doing so. You would write this using the lme function in the nlme pacakge in R using the following code:

lme(mass ~ treatment1 + treatment2 + treatment1*treatment2, random = ~1|initial_mass)
  • $\begingroup$ I'm not convinced of this. Supposing each subject's initial weight is different, I think this equivalent to the model with random = ~1|subject. Is that the best way to account for weight effects specifically? $\endgroup$
    – Russ Lenth
    Commented Jun 6, 2015 at 16:16
  • $\begingroup$ @rvl I believe this would generate the same result, but have not tested it! $\endgroup$
    – colin
    Commented Jun 14, 2015 at 17:23

That is probably not appropriate. Using initial mass as a weighting factor is not taking it into account in prediction; instead, it is giving the observations with bigger masses more influence in determining the regression equation. An additional implication is that your model now assumes that the observations with larger initial masses are less variable than those with small initial masses. If anything, I'd guess the reverse is true.

The two most common ways of dealing with a situation like this are

  1. Including initial mass as a predictor in the model (I.e., a covariate)

    lme(mass ~ initial_mass + treatment1*treatment2)

Or, perhaps better,

lme(log(mass) ~ log(initial_mass) + treatment1*treatment2)
  1. Dividing the response variable by initial mass, and using that quotient as the Y variable. (Generally, adjusting the response for baseline -- often by subtraction, but division seems intuitively more appropriate here)

    lme(mass/initial_mass ~ treatment1*treatment2)

By the way, in R, the interaction operator is :, and a*b is equivalent to a + b + a:b


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.