Skip to content
Prev 19020 / 20628 Next

Set two coefficients to be equal in lme()

If D1 and D2 are coded {-.5, .5} as you suggested in a separate email, then D1+D2 = 0 if all cases either belong to group D1 or D2 and never both. Then read Treat * new_var = 0, a constant not a variable.

In that case, simply use Treat in the model by itself - again, this is the same as constraining both groups to have the same Treat coefficient.

lme(value ~ 0 + D1 + D2 + Treat, random = ~0 + D1 + D2 | Student, data = data)

Also, basic idea behind all this is: b * x1 + b * x2 = b * (x1 + x2).

James.