Hi all,
I have fit the model below, and just wanted to make sure of the correct way to do a certain set of pairwise comparisons. I want to see whether the average on the outcome variable (adhdsev) was significantly higher than at the starting point (TimeWeight=0), for each of the four remaining timepoints (TimeWeight 1-4). I'd like to do this separately by i.adhdsubtype (3 possible subtypes, for a total of 12 pairwise comparisons). I would also like to do the same for overall means (not broken down by subtype, 4 pairwise comparisons). I was able to run margins with confidence intervals but I thought something like pwcompare might be necessary in order to do multiple comparisons. However I'm uncertain as to how to specify the levels for pwcompare for a continuous variable.
I also wanted to find out if there's any caveats in interpreting comparisons (or margins) given the presence of the additional interaction in the model of i.adhdsubtype#c.TimeWeight#c.TimeWeight. E.g. are the marginal means set for a certain value in the deceleration of the slope that might make interpretation difficult?
I have fit the model below, and just wanted to make sure of the correct way to do a certain set of pairwise comparisons. I want to see whether the average on the outcome variable (adhdsev) was significantly higher than at the starting point (TimeWeight=0), for each of the four remaining timepoints (TimeWeight 1-4). I'd like to do this separately by i.adhdsubtype (3 possible subtypes, for a total of 12 pairwise comparisons). I would also like to do the same for overall means (not broken down by subtype, 4 pairwise comparisons). I was able to run margins with confidence intervals but I thought something like pwcompare might be necessary in order to do multiple comparisons. However I'm uncertain as to how to specify the levels for pwcompare for a continuous variable.
I also wanted to find out if there's any caveats in interpreting comparisons (or margins) given the presence of the additional interaction in the model of i.adhdsubtype#c.TimeWeight#c.TimeWeight. E.g. are the marginal means set for a certain value in the deceleration of the slope that might make interpretation difficult?
Code:
. mixed adhdsev c.TimeWeight c.TimeWeight#i.adhdsubtype c.TimeWeight#c.TimeWeight i.adhdsubtype#c.TimeWeight#c.TimeWeight, ///
> || id: TimeWeight, variance mle covariance(unstructured) ///
> residuals(independent,t(TimeWeight)),
Note: t() not required for this residual structure; ignored
Performing EM optimization:
Performing gradient-based optimization:
Iteration 0: log likelihood = -434.58713
Iteration 1: log likelihood = -432.68323
Iteration 2: log likelihood = -432.66667
Iteration 3: log likelihood = -432.66667
Computing standard errors:
Mixed-effects ML regression Number of obs = 244
Group variable: id Number of groups = 93
Obs per group:
min = 1
avg = 2.6
max = 4
Wald chi2(6) = 62.99
Log likelihood = -432.66667 Prob > chi2 = 0.0000
-----------------------------------------------------------------------------------------------------------------
adhdsev | Coef. Std. Err. z P>|z| [95% Conf. Interval]
------------------------------------------------+----------------------------------------------------------------
TimeWeight | -.1340633 .360817 -0.37 0.710 -.8412517 .573125
|
adhdsubtype#c.TimeWeight |
ADHD, Predominantly Innattentive Type | -1.540448 .4016991 -3.83 0.000 -2.327764 -.7531322
ADHD, Predominantly Hyperactive-Impulsive Type | -2.915497 .9290948 -3.14 0.002 -4.736489 -1.094505
|
c.TimeWeight#c.TimeWeight | -.0286886 .1192213 -0.24 0.810 -.2623581 .2049809
|
adhdsubtype#c.TimeWeight#c.TimeWeight |
ADHD, Predominantly Innattentive Type | .4004778 .1331424 3.01 0.003 .1395235 .6614322
ADHD, Predominantly Hyperactive-Impulsive Type | .7815377 .3276643 2.39 0.017 .1393275 1.423748
|
_cons | 4.752859 .1239529 38.34 0.000 4.509916 4.995802
-----------------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------
Random-effects Parameters | Estimate Std. Err. [95% Conf. Interval]
-----------------------------+------------------------------------------------
id: Unstructured |
var(TimeWe~t) | .2278224 .0975934 .0983927 .527509
var(_cons) | .0480474 .0567667 .0047424 .4867911
cov(TimeWe~t,_cons) | .1046244 .0546602 -.0025076 .2117563
-----------------------------+------------------------------------------------
var(Residual) | 1.463658 .1712223 1.163761 1.840836
------------------------------------------------------------------------------
LR test vs. linear model: chi2(3) = 21.75 Prob > chi2 = 0.0001
Note: LR test is conservative and provided only for reference.
.
. estimates store quadpredict ,
. lrtest final quadpredict
Likelihood-ratio test LR chi2(2) = 10.69
(Assumption: final nested in quadpredict) Prob > chi2 = 0.0048
. margins i.adhdsubtype, at(TimeWeight=(0(1)4)) vsquish
Adjusted predictions Number of obs = 244
Expression : Linear prediction, fixed portion, predict()
1._at : TimeWeight = 0
2._at : TimeWeight = 1
3._at : TimeWeight = 2
4._at : TimeWeight = 3
5._at : TimeWeight = 4
-------------------------------------------------------------------------------------------------------------------
| Delta-method
| Margin Std. Err. z P>|z| [95% Conf. Interval]
--------------------------------------------------+----------------------------------------------------------------
_at#adhdsubtype |
1#ADHD, Combined Type | 4.752859 .1239529 38.34 0.000 4.509916 4.995802
1#ADHD, Predominantly Innattentive Type | 4.752859 .1239529 38.34 0.000 4.509916 4.995802
1#ADHD, Predominantly Hyperactive-Impulsive Type | 4.752859 .1239529 38.34 0.000 4.509916 4.995802
2#ADHD, Combined Type | 4.590107 .2435981 18.84 0.000 4.112664 5.067551
2#ADHD, Predominantly Innattentive Type | 3.450137 .1640803 21.03 0.000 3.128545 3.771728
2#ADHD, Predominantly Hyperactive-Impulsive Type | 2.456148 .5955657 4.12 0.000 1.28886 3.623435
3#ADHD, Combined Type | 4.369978 .3426055 12.76 0.000 3.698483 5.041473
3#ADHD, Predominantly Innattentive Type | 2.890993 .2343395 12.34 0.000 2.431696 3.35029
3#ADHD, Predominantly Hyperactive-Impulsive Type | 1.665134 .7704188 2.16 0.031 .1551414 3.175128
4#ADHD, Combined Type | 4.092471 .4908227 8.34 0.000 3.130477 5.054466
4#ADHD, Predominantly Innattentive Type | 3.075428 .3050299 10.08 0.000 2.47758 3.673275
4#ADHD, Predominantly Hyperactive-Impulsive Type | 2.379819 1.083324 2.20 0.028 .2565441 4.503094
5#ADHD, Combined Type | 3.757588 .9069076 4.14 0.000 1.980081 5.535094
5#ADHD, Predominantly Innattentive Type | 4.003441 .508255 7.88 0.000 3.007279 4.999602
5#ADHD, Predominantly Hyperactive-Impulsive Type | 4.600202 2.19747 2.09 0.036 .2932402 8.907164
-------------------------------------------------------------------------------------------------------------------
. marginsplot, x(TimeWeight)
Variables that uniquely identify margins: TimeWeight adhdsubtype

Comment