Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • how best to account for matching/pairing in mixed effects models

    I have 30 participants that have been matched/paired on 5 potential confounders, 15 have arthritis and 15 are asymptomatic. I want to measure the difference of a continuous outcome variable (a measure of boney alignment) between those with and without arthritis, under four different conditions (4 different angles of knee flexion, which has some inherent error due to use of goniometry).

    I have tried two approaches:

    (i) xtmixed using the raw data (i.e. 30 groups, 120 observations, 4 observations per group) and including ARTHRITIS, i.ANGLE and i.PAIR in the fixed part of the model.

    (ii) xtmixed using the simple difference method (i.e. 15 groups, 60 observations, 4 obs per group) and including i.ANGLE, but not ARTHRITIS or i.PAIR in the fixed portion since I am modeling the difference due to arthritis by pair.

    For both approaches, I have added the random portion as || PAIR: ANGLE, cov(un)

    The results are substantially different, and I am not sure how to explain this, so not sure which approach is superior. How do I best model/estimate the effect of arthritis on alignment using (and statistically accounting for) a matched case-control design?

    (i) B[ARTHRITIS] = -2.4 SE = 1.1 p= 0.02
    (ii) _cons = -1.7 SE = 2.0 p = 0.396

    Kind regards,
    Erin Macri





  • #2
    First, did you really want to include i.PAIR in the fixed part of the model in the first approach?

    Second, the way that you set up the random part, it treats angle as continuous. Given that, you might want to treat angle as continuous in the fixed part, too.

    Third, the second approach essentially examines the arthritis × angle interaction. (See the output below to see what I mean: the angle regression coefficient in the second model is the same as the arthritis × angle interaction coefficient in the first model. And when you have an interaction term in the first model, then the constant term in the second model is the same as the arthritis term in the first model like you were expecting. See below.) You don't have any such interaction term in your first approach—the two models that you show aren't really comparable.

    Fourth, when you subtract the two observations within pairs, you're subtracting out the random effects of pair and angle, which are both common to both members of the pair. If your matching criteria were reasonably effective, then what you have left could be quite small and poorly estimated (see below). At least omit the random slope for angle from the second approach.

    I would suggest something more akin to your first approach, but with an interaction term unless you are not interested in how bone alignment differs between arthritic patients and asymptomatic adults as a function of knee flexion. Also, because you have a very small sample size, I suggest the use of a small-sample option (dfmethod()).

    .ÿversionÿ14.2

    .ÿ
    .ÿclearÿ*

    .ÿsetÿmoreÿoff

    .ÿsetÿseedÿ1384714

    .ÿquietlyÿsetÿobsÿ15

    .ÿ
    .ÿgenerateÿbyteÿpairÿ=ÿ_n

    .ÿgenerateÿdoubleÿuÿ=ÿrnormal()

    .ÿgenerateÿdoubleÿaÿ=ÿrnormal()ÿ/ÿ2ÿ//ÿrandomÿslopeÿforÿangle

    .ÿ
    .ÿquietlyÿexpandÿ4

    .ÿbysortÿpair:ÿgenerateÿbyteÿangleÿ=ÿ_n

    .ÿ
    .ÿquietlyÿexpandÿ2

    .ÿbysortÿpairÿangle:ÿgenerateÿbyteÿarthritisÿ=ÿ_nÿ==ÿ2

    .ÿ
    .ÿgenerateÿdoubleÿalignmentÿ=ÿuÿ+ÿ(angleÿ-ÿ2.5)ÿ/ÿ1.5ÿ*ÿaÿ+ÿrnormal()

    .ÿ
    .ÿ*
    .ÿ*ÿFirstÿ(withÿinteractionÿterm)
    .ÿ*
    .ÿmixedÿalignmentÿi.arthritis##c.angleÿ||ÿpair:ÿangle,ÿcovariance(unstructured)ÿ///
    >ÿÿÿÿÿÿÿÿÿremlÿdfmethod(kroger)ÿnolrtestÿnolog

    Mixed-effectsÿREMLÿregressionÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿobsÿÿÿÿÿ=ÿÿÿÿÿÿÿÿ120
    Groupÿvariable:ÿpairÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿgroupsÿÿ=ÿÿÿÿÿÿÿÿÿ15

    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿObsÿperÿgroup:
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿminÿ=ÿÿÿÿÿÿÿÿÿÿ8
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿavgÿ=ÿÿÿÿÿÿÿÿ8.0
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿmaxÿ=ÿÿÿÿÿÿÿÿÿÿ8
    DFÿmethod:ÿKenward-RogerÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿDF:ÿÿÿÿÿÿÿÿÿÿÿminÿ=ÿÿÿÿÿÿ22.66
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿavgÿ=ÿÿÿÿÿÿ55.91
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿmaxÿ=ÿÿÿÿÿÿ88.00

    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿF(3,ÿÿÿÿ47.89)ÿÿÿÿ=ÿÿÿÿÿÿÿ3.61
    Logÿrestricted-likelihoodÿ=ÿ-189.63243ÿÿÿÿÿÿÿÿÿÿProbÿ>ÿFÿÿÿÿÿÿÿÿÿÿ=ÿÿÿÿÿ0.0197

    -----------------------------------------------------------------------------------
    ÿÿÿÿÿÿÿÿalignmentÿ|ÿÿÿÿÿÿCoef.ÿÿÿStd.ÿErr.ÿÿÿÿÿÿtÿÿÿÿP>|t|ÿÿÿÿÿ[95%ÿConf.ÿInterval]
    ------------------+----------------------------------------------------------------
    ÿÿÿÿÿÿ1.arthritisÿ|ÿÿÿ1.327306ÿÿÿ.4193874ÿÿÿÿÿ3.16ÿÿÿ0.002ÿÿÿÿÿ.4938618ÿÿÿÿÿ2.16075
    ÿÿÿÿÿÿÿÿÿÿÿÿangleÿ|ÿÿÿ.2788504ÿÿÿ.1506206ÿÿÿÿÿ1.85ÿÿÿ0.076ÿÿÿÿ-.0313741ÿÿÿÿ.5890749
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|
    arthritis#c.angleÿ|
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ1ÿÿ|ÿÿ-.5056027ÿÿÿ.1531386ÿÿÿÿ-3.30ÿÿÿ0.001ÿÿÿÿ-.8099335ÿÿÿ-.2012719
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|
    ÿÿÿÿÿÿÿÿÿÿÿÿ_consÿ|ÿÿ-.3822275ÿÿÿ.4483297ÿÿÿÿ-0.85ÿÿÿ0.403ÿÿÿÿ-1.310448ÿÿÿÿ.5459934
    -----------------------------------------------------------------------------------

    ------------------------------------------------------------------------------
    ÿÿRandom-effectsÿParametersÿÿ|ÿÿÿEstimateÿÿÿStd.ÿErr.ÿÿÿÿÿ[95%ÿConf.ÿInterval]
    -----------------------------+------------------------------------------------
    pair:ÿUnstructuredÿÿÿÿÿÿÿÿÿÿÿ|
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿvar(angle)ÿ|ÿÿÿ.1644128ÿÿÿ.0962985ÿÿÿÿÿÿ.0521647ÿÿÿÿ.5181964
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿvar(_cons)ÿ|ÿÿÿ1.695849ÿÿÿ.8958016ÿÿÿÿÿÿ.6022205ÿÿÿÿ4.775502
    ÿÿÿÿÿÿÿÿÿÿÿÿcov(angle,_cons)ÿ|ÿÿ-.3215207ÿÿÿ.2539509ÿÿÿÿÿ-.8192553ÿÿÿÿ.1762138
    -----------------------------+------------------------------------------------
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿvar(Residual)ÿ|ÿÿÿ.8794289ÿÿÿ.1325789ÿÿÿÿÿÿ.6544512ÿÿÿÿ1.181746
    ------------------------------------------------------------------------------

    .ÿ
    .ÿ*
    .ÿ*ÿSecond
    .ÿ*
    .ÿquietlyÿreshapeÿwideÿalignment,ÿi(pairÿangle)ÿj(arthritis)

    .ÿgenerateÿdoubleÿdeltaÿ=ÿalignment1ÿ-ÿalignment0

    .ÿ
    .ÿmixedÿdeltaÿc.angleÿ||ÿpair:ÿ,ÿremlÿdfmethod(kroger)ÿnolrtestÿnolog

    Mixed-effectsÿREMLÿregressionÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿobsÿÿÿÿÿ=ÿÿÿÿÿÿÿÿÿ60
    Groupÿvariable:ÿpairÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿgroupsÿÿ=ÿÿÿÿÿÿÿÿÿ15

    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿObsÿperÿgroup:
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿminÿ=ÿÿÿÿÿÿÿÿÿÿ4
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿavgÿ=ÿÿÿÿÿÿÿÿ4.0
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿmaxÿ=ÿÿÿÿÿÿÿÿÿÿ4
    DFÿmethod:ÿKenward-RogerÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿDF:ÿÿÿÿÿÿÿÿÿÿÿminÿ=ÿÿÿÿÿÿ44.00
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿavgÿ=ÿÿÿÿÿÿ50.44
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿmaxÿ=ÿÿÿÿÿÿ56.88

    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿF(1,ÿÿÿÿ44.00)ÿÿÿÿ=ÿÿÿÿÿÿ10.35
    Logÿrestricted-likelihoodÿ=ÿ-105.10649ÿÿÿÿÿÿÿÿÿÿProbÿ>ÿFÿÿÿÿÿÿÿÿÿÿ=ÿÿÿÿÿ0.0024

    ------------------------------------------------------------------------------
    ÿÿÿÿÿÿÿdeltaÿ|ÿÿÿÿÿÿCoef.ÿÿÿStd.ÿErr.ÿÿÿÿÿÿtÿÿÿÿP>|t|ÿÿÿÿÿ[95%ÿConf.ÿInterval]
    -------------+----------------------------------------------------------------
    ÿÿÿÿÿÿÿangleÿ|ÿÿ-.5056027ÿÿÿ.1571712ÿÿÿÿ-3.22ÿÿÿ0.002ÿÿÿÿ-.8223605ÿÿÿ-.1888449
    ÿÿÿÿÿÿÿ_consÿ|ÿÿÿ1.327306ÿÿÿ.4342957ÿÿÿÿÿ3.06ÿÿÿ0.003ÿÿÿÿÿ.4576054ÿÿÿÿ2.197007
    ------------------------------------------------------------------------------

    ------------------------------------------------------------------------------
    ÿÿRandom-effectsÿParametersÿÿ|ÿÿÿEstimateÿÿÿStd.ÿErr.ÿÿÿÿÿ[95%ÿConf.ÿInterval]
    -----------------------------+------------------------------------------------
    pair:ÿIdentityÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿvar(_cons)ÿ|ÿÿÿÿ.050127ÿÿÿ.2176986ÿÿÿÿÿÿ.0000101ÿÿÿÿ249.3383
    -----------------------------+------------------------------------------------
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿvar(Residual)ÿ|ÿÿÿÿ1.85271ÿÿÿ.3950004ÿÿÿÿÿÿ1.219916ÿÿÿÿ2.813745
    ------------------------------------------------------------------------------

    .ÿ
    .ÿexit

    endÿofÿdo-file


    .

    Comment


    • #3
      Brilliant, thank you so much Joseph Coveney.

      Comment

      Working...
      X