Hi,
I've been trying to use the lincom function after fitting the multilevel mixed effects model below. Briefly, OUT is the dependent variable, GRP (1/0) and CONCEN(0-3) are explanatory variables, and id is a level 2 variable (repeated measures being level 1). I have made repeated measures on each sample (id) at four concentrations/timepoints (CONCEN), and wish to know if the predicted value of OUT at CONCEN 3 is significantly different from baseline in GRP=1. This follows on from my previous post "Help with interpreting xtmixed output" of 28 Nov.
In reference to Clyde's answer re: 2 equation approach, I think I've got it, but just to be sure, I've referred to his original equations, and used an example with the slightly more complicated GRP=1 below:
So, if I've understood correctly, this is where the coefficients in your equations come from (colour-matched).
As an example for GRP1 between CONCEN3 and CONCEN0:
At 0
_cons + _b[1.GRP] + (_b[CONCEN] + _b[1.GRP#CONCEN])* CONCEN
At 3
_cons + _b[1.GRP] + (_b[CONCEN] + _b[1.GRP#CONCEN])* CONCEN
Difference:
= (_b[CONCEN] + _b[1.GRP#CONCEN])* CONCEN
= (_b[CONCEN] + _b[1.GRP#CONCEN])* 3
= (-1.495 + 2.635) * 3
= 3.42
which is the same as I get with (albeit without p-value and CIs)
And, as the p-value for this is 0.023, this suggests there is a significant difference between CONCEN 3 and 0 for GRP1, right?
thanks
Jem
I've been trying to use the lincom function after fitting the multilevel mixed effects model below. Briefly, OUT is the dependent variable, GRP (1/0) and CONCEN(0-3) are explanatory variables, and id is a level 2 variable (repeated measures being level 1). I have made repeated measures on each sample (id) at four concentrations/timepoints (CONCEN), and wish to know if the predicted value of OUT at CONCEN 3 is significantly different from baseline in GRP=1. This follows on from my previous post "Help with interpreting xtmixed output" of 28 Nov.
In reference to Clyde's answer re: 2 equation approach, I think I've got it, but just to be sure, I've referred to his original equations, and used an example with the slightly more complicated GRP=1 below:
Code:
xtmixed OUT i.GRP##c.CONCEN || id: CONCEN, mle variance ------------------------------------------------------------------------------ OUT | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- 1.GRP | 18.73228 8.295914 2.26 0.024 2.472583 34.99197 CONCEN | -1.495238 .5285768 -2.83 0.005 -2.53123 -.4592467 | GRP#c.CONCEN | 1 | 2.635238 .7285928 3.62 0.000 1.207222 4.063254 | _cons | 38.20106 6.018489 6.35 0.000 26.40504 49.99708 ------------------------------------------------------------------------------ Group 0: OUT = b0 + b1*CONC + error Group 1: OUT = c0 + c1*CONC + error b0 = _cons, b1 = _b[CONCEN] c0 = _cons + _b[1.GRP], c1 = _b[CONCEN] + _b[1.GRP#CONCEN]
As an example for GRP1 between CONCEN3 and CONCEN0:
At 0
_cons + _b[1.GRP] + (_b[CONCEN] + _b[1.GRP#CONCEN])* CONCEN
At 3
_cons + _b[1.GRP] + (_b[CONCEN] + _b[1.GRP#CONCEN])* CONCEN
Difference:
= (_b[CONCEN] + _b[1.GRP#CONCEN])* CONCEN
= (_b[CONCEN] + _b[1.GRP#CONCEN])* 3
= (-1.495 + 2.635) * 3
= 3.42
which is the same as I get with (albeit without p-value and CIs)
Code:
. lincom 3*(CONCEN + 1.GRP#c.CONCEN) ( 1) 3*[OUT]CONCEN + 3*[OUT]1.GRP#c.CONCEN = 0 ------------------------------------------------------------------------------ OUT | Coef. Std. Err. z P>|z| [95% Conf. Interval] -------------+---------------------------------------------------------------- (1) | 3.42 1.504356 2.27 0.023 .4715167 6.368483 ------------------------------------------------------------------------------
thanks
Jem
Comment