Announcement

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

  • How to adjust the correlation using GEE before running any other statistical test?

    Dear All,

    I am having a confusing question, but need to know the solution, because we are working with this kind of data regularly.

    Question:

    How to control or adjust the correlation between the two eyes of the patients involved in the study?
    In my dataset, for some person we are taking one eye only and for some person we are taking both eyes (eligible for the study).
    While taking both eyes in to account, we need to adjust them before running any statistical test.
    I came across one article, where they have mentioned the table title as "Multivariate Logistic Regression Analysis Using the General Estimating Equation to Determine the Association Between Blood
    Pressure Levels
    ". Even though, the interpretation are in the odds ratio, but not understanding, how and where they have used the GEE model.

    Please help me out in this, which will help us to give a better inference.


    Thanks a lot in advance.



    WR,
    Divya

  • #2
    I have no idea what the authors in your one article that you came across did for their strangely titled table, and your question is a little vague and open-ended, but you can use xtgee to fit a model involving correlated observations by means of generalized estimating equations.
    Code:
    help xtgee
    An illustration of the mechanics of the approach is shown below with a fake dataset that resembles bilateral measures of intraocular pressure in a cross-section of people. Begin at the "Begin here" comment.

    .ÿ
    .ÿversionÿ16.1

    .ÿ
    .ÿclearÿ*

    .ÿ
    .ÿsetÿseedÿ`=strreverse("1577436")'

    .ÿ
    .ÿ//ÿIntraocularÿpressure
    .ÿquietlyÿdrawnormÿiop0ÿiop1,ÿdoubleÿ///
    >ÿÿÿÿÿmean(15ÿ15)ÿsd(3ÿ3)ÿÿcorr(1ÿ0.75ÿ\ÿ0.75ÿ1)ÿ///
    >ÿÿÿÿÿÿÿÿÿn(250)

    .ÿ
    .ÿ//ÿPatients
    .ÿgenerateÿintÿpidÿ=ÿ_n

    .ÿgenerateÿbyteÿageÿ=ÿruniformint(40,ÿ80)

    .ÿ
    .ÿ//ÿLeftÿandÿright
    .ÿquietlyÿreshapeÿlongÿiop,ÿi(pid)ÿj(sid)

    .ÿlabelÿdefineÿSidesÿ0ÿOSÿ1ÿOD

    .ÿlabelÿvaluesÿsidÿSides

    .ÿ
    .ÿquietlyÿreplaceÿiopÿ=ÿiopÿ-ÿ3ÿ/ÿ40ÿ*ÿ(ageÿ-ÿ40)

    .ÿ
    .ÿ*
    .ÿ*ÿBeginÿhere
    .ÿ*
    .ÿ
    .ÿ//ÿHere'sÿoneÿway
    .ÿxtgeeÿiopÿi.sidÿc.age,ÿi(pid)ÿfamily(gaussian)ÿlink(identity)ÿ///
    >ÿÿÿÿÿcorr(exchangeable)ÿvce(bootstrap,ÿreps(1000)ÿnodots)ÿnolog

    GEEÿpopulation-averagedÿmodelÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿobsÿÿÿÿÿ=ÿÿÿÿÿÿÿÿ500
    Groupÿvariable:ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿpidÿÿÿÿÿÿNumberÿofÿgroupsÿÿ=ÿÿÿÿÿÿÿÿ250
    Link:ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿidentityÿÿÿÿÿÿObsÿperÿgroup:
    Family:ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿGaussianÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿminÿ=ÿÿÿÿÿÿÿÿÿÿ2
    Correlation:ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿexchangeableÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿavgÿ=ÿÿÿÿÿÿÿÿ2.0
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿmaxÿ=ÿÿÿÿÿÿÿÿÿÿ2
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿWaldÿchi2(2)ÿÿÿÿÿÿ=ÿÿÿÿÿÿ44.78
    Scaleÿparameter:ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ9.303406ÿÿÿÿÿÿProbÿ>ÿchi2ÿÿÿÿÿÿÿ=ÿÿÿÿÿ0.0000

    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ(Replicationsÿbasedÿonÿ250ÿclustersÿinÿpid)
    ------------------------------------------------------------------------------
    ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿObservedÿÿÿBootstrapÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNormal-based
    ÿÿÿÿÿÿÿÿÿiopÿ|ÿÿÿÿÿÿCoef.ÿÿÿStd.ÿErr.ÿÿÿÿÿÿzÿÿÿÿP>|z|ÿÿÿÿÿ[95%ÿConf.ÿInterval]
    -------------+----------------------------------------------------------------
    ÿÿÿÿÿÿÿÿÿsidÿ|
    ÿÿÿÿÿÿÿÿÿODÿÿ|ÿÿÿ.1284944ÿÿÿ.1414448ÿÿÿÿÿ0.91ÿÿÿ0.364ÿÿÿÿ-.1487323ÿÿÿÿÿ.405721
    ÿÿÿÿÿÿÿÿÿageÿ|ÿÿ-.0999918ÿÿÿ.0151579ÿÿÿÿ-6.60ÿÿÿ0.000ÿÿÿÿ-.1297009ÿÿÿ-.0702828
    ÿÿÿÿÿÿÿ_consÿ|ÿÿÿ19.19904ÿÿÿ.9497496ÿÿÿÿ20.21ÿÿÿ0.000ÿÿÿÿÿ17.33756ÿÿÿÿ21.06051
    ------------------------------------------------------------------------------

    .ÿestatÿwcorrelation

    Estimatedÿwithin-pidÿcorrelationÿmatrixÿR:

    ÿÿÿÿÿÿ|ÿÿÿÿÿÿÿÿc1ÿÿÿÿÿÿÿÿÿc2ÿ
    ------+----------------------
    ÿÿÿr1ÿ|ÿÿÿÿÿÿÿÿÿ1ÿÿÿÿÿÿÿÿÿÿÿÿ
    ÿÿÿr2ÿ|ÿÿ.7333626ÿÿÿÿÿÿÿÿÿÿ1ÿ

    .ÿ
    .ÿ//ÿHere'sÿanother
    .ÿxtgeeÿiopÿi.sidÿc.age,ÿi(pid)ÿfamily(gaussian)ÿlink(identity)ÿ///
    >ÿÿÿÿÿcorr(independent)ÿvce(robust)ÿnolog

    GEEÿpopulation-averagedÿmodelÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿobsÿÿÿÿÿ=ÿÿÿÿÿÿÿÿ500
    Groupÿvariable:ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿpidÿÿÿÿÿÿNumberÿofÿgroupsÿÿ=ÿÿÿÿÿÿÿÿ250
    Link:ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿidentityÿÿÿÿÿÿObsÿperÿgroup:
    Family:ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿGaussianÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿminÿ=ÿÿÿÿÿÿÿÿÿÿ2
    Correlation:ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿindependentÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿavgÿ=ÿÿÿÿÿÿÿÿ2.0
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿmaxÿ=ÿÿÿÿÿÿÿÿÿÿ2
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿWaldÿchi2(2)ÿÿÿÿÿÿ=ÿÿÿÿÿÿ45.98
    Scaleÿparameter:ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ9.303406ÿÿÿÿÿÿProbÿ>ÿchi2ÿÿÿÿÿÿÿ=ÿÿÿÿÿ0.0000

    Pearsonÿchi2(500):ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ4651.70ÿÿÿÿÿÿDevianceÿÿÿÿÿÿÿÿÿÿ=ÿÿÿÿ4651.70
    Dispersionÿ(Pearson):ÿÿÿÿÿÿÿÿÿÿÿÿÿ9.303406ÿÿÿÿÿÿDispersionÿÿÿÿÿÿÿÿ=ÿÿÿ9.303406

    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ(Std.ÿErr.ÿadjustedÿforÿclusteringÿonÿpid)
    ------------------------------------------------------------------------------
    ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿRobust
    ÿÿÿÿÿÿÿÿÿiopÿ|ÿÿÿÿÿÿCoef.ÿÿÿStd.ÿErr.ÿÿÿÿÿÿzÿÿÿÿP>|z|ÿÿÿÿÿ[95%ÿConf.ÿInterval]
    -------------+----------------------------------------------------------------
    ÿÿÿÿÿÿÿÿÿsidÿ|
    ÿÿÿÿÿÿÿÿÿODÿÿ|ÿÿÿ.1284944ÿÿÿ.1411552ÿÿÿÿÿ0.91ÿÿÿ0.363ÿÿÿÿ-.1481647ÿÿÿÿ.4051535
    ÿÿÿÿÿÿÿÿÿageÿ|ÿÿ-.0999918ÿÿÿ.0149808ÿÿÿÿ-6.67ÿÿÿ0.000ÿÿÿÿ-.1293536ÿÿÿÿÿ-.07063
    ÿÿÿÿÿÿÿ_consÿ|ÿÿÿ19.19904ÿÿÿ.9499595ÿÿÿÿ20.21ÿÿÿ0.000ÿÿÿÿÿ17.33715ÿÿÿÿ21.06092
    ------------------------------------------------------------------------------

    .ÿ
    .ÿexit

    endÿofÿdo-file


    .


    You can also fit the either model above using xtreg with its pa option, and you can fit the second one using glm with its vce(cluster <varname>) option.
    Code:
    help xtreg

    Comment


    • #3
      @#1: I had a quick look and I think they have grouped their study population into 'healthy' vs. 'Unhealthy/Glaucomatous' eye status and coded as 0, 1 and fitted GEE model with BP as their main predictor.
      Last edited by Roman Mostazir; 16 Oct 2020, 10:01. Reason: correct typo
      Roman

      Comment


      • #4
        Thanks a lot for your answer for my question/confusion.

        I understood the GEE concept, what you have mentioned above.
        But my exact question is,

        for example:

        IOP (intraocular pressure) is available for 20 patients in both eyes, and 10 patients in single eye (totally 30 patients and 50 eyes IOP is there in the dataset).
        Now, my objective is to compare this IOP (continuous variable) between two groups ( A and B ) using two sample t-test.
        so my query is, do we need to adjust for the 20 patients, whose IOP is available in both eyes by GEE or any other model, before running two sample t-test??

        In that case, please explain me with Stata codes for the above scenario.


        Hope i am clear with my question.


        Thank you,
        WR,
        Divya



        Comment


        • #5
          The answer to your question depends upon why the values are missing for one-third of the patients. If the mechanism of missingness is similar to that at the top of the output below, then you could get your t statistic in the manner shown in the bottom of the output below.

          .ÿ
          .ÿversionÿ16.1

          .ÿ
          .ÿclearÿ*

          .ÿ
          .ÿsetÿseedÿ`=strreverse("1577581")'

          .ÿ
          .ÿquietlyÿdrawnormÿiop0ÿiop1,ÿdoubleÿcorr(1ÿ0.75ÿ\ÿ0.75ÿ1)ÿn(30)

          .ÿgenerateÿbyteÿpidÿ=ÿ_n

          .ÿgenerateÿbyteÿtrtÿ=ÿmod(_n,ÿ2)

          .ÿ
          .ÿgenerateÿdoubleÿranduÿ=ÿruniform()

          .ÿsortÿrandu

          .ÿgenerateÿbyteÿmisÿ=ÿ_nÿ<=ÿ10

          .ÿ
          .ÿquietlyÿreshapeÿlongÿiop,ÿi(pid)ÿj(sid)

          .ÿ
          .ÿquietlyÿreplaceÿranduÿ=ÿruniform()

          .ÿquietlyÿbysortÿpidÿ(randu):ÿdropÿifÿ_nÿ==ÿ1ÿ&ÿmis

          .ÿ
          .ÿ*
          .ÿ*ÿBeginÿhere
          .ÿ*
          .ÿmixedÿiopÿi.trt##i.sidÿ||ÿpid:ÿ,ÿremlÿdfmethod(kroger)ÿnolrtestÿnolog

          Mixed-effectsÿREMLÿregressionÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿobsÿÿÿÿÿ=ÿÿÿÿÿÿÿÿÿ50
          Groupÿvariable:ÿpidÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿNumberÿofÿgroupsÿÿ=ÿÿÿÿÿÿÿÿÿ30

          ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿObsÿperÿgroup:
          ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿminÿ=ÿÿÿÿÿÿÿÿÿÿ1
          ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿavgÿ=ÿÿÿÿÿÿÿÿ1.7
          ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿmaxÿ=ÿÿÿÿÿÿÿÿÿÿ2
          DFÿmethod:ÿKenward-RogerÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿDF:ÿÿÿÿÿÿÿÿÿÿÿminÿ=ÿÿÿÿÿÿ20.17
          ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿavgÿ=ÿÿÿÿÿÿ29.77
          ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿmaxÿ=ÿÿÿÿÿÿ40.12

          ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿF(3,ÿÿÿÿ28.56)ÿÿÿÿ=ÿÿÿÿÿÿÿ1.25
          Logÿrestricted-likelihoodÿ=ÿ-61.013865ÿÿÿÿÿÿÿÿÿÿProbÿ>ÿFÿÿÿÿÿÿÿÿÿÿ=ÿÿÿÿÿ0.3085

          ------------------------------------------------------------------------------
          ÿÿÿÿÿÿÿÿÿiopÿ|ÿÿÿÿÿÿCoef.ÿÿÿStd.ÿErr.ÿÿÿÿÿÿtÿÿÿÿP>|t|ÿÿÿÿÿ[95%ÿConf.ÿInterval]
          -------------+----------------------------------------------------------------
          ÿÿÿÿÿÿÿ1.trtÿ|ÿÿÿÿ.432768ÿÿÿ.3675107ÿÿÿÿÿ1.18ÿÿÿ0.246ÿÿÿÿ-.3108969ÿÿÿÿ1.176433
          ÿÿÿÿÿÿÿ1.sidÿ|ÿÿÿ.2564637ÿÿÿ.2165415ÿÿÿÿÿ1.18ÿÿÿ0.250ÿÿÿÿ-.1949877ÿÿÿÿ.7079152
          ÿÿÿÿÿÿÿÿÿÿÿÿÿ|
          ÿÿÿÿÿtrt#sidÿ|
          ÿÿÿÿÿÿÿÿ1ÿ1ÿÿ|ÿÿ-.0328746ÿÿÿ.3058477ÿÿÿÿ-0.11ÿÿÿ0.915ÿÿÿÿ-.6703244ÿÿÿÿ.6045752
          ÿÿÿÿÿÿÿÿÿÿÿÿÿ|
          ÿÿÿÿÿÿÿ_consÿ|ÿÿÿ-.222313ÿÿÿ.2658144ÿÿÿÿ-0.84ÿÿÿ0.408ÿÿÿÿ-.7594921ÿÿÿÿ.3148661
          ------------------------------------------------------------------------------

          ------------------------------------------------------------------------------
          ÿÿRandom-effectsÿParametersÿÿ|ÿÿÿEstimateÿÿÿStd.ÿErr.ÿÿÿÿÿ[95%ÿConf.ÿInterval]
          -----------------------------+------------------------------------------------
          pid:ÿIdentityÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ|
          ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿvar(_cons)ÿ|ÿÿÿ.6517572ÿÿÿ.2236883ÿÿÿÿÿÿ.3326187ÿÿÿÿÿÿ1.2771
          -----------------------------+------------------------------------------------
          ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿvar(Residual)ÿ|ÿÿÿ.2446704ÿÿÿ.0813353ÿÿÿÿÿÿ.1275317ÿÿÿÿ.4694017
          ------------------------------------------------------------------------------

          .ÿcontrastÿtrtÿsidÿtrt#sid,ÿsmall

          Contrastsÿofÿmarginalÿlinearÿpredictions

          Marginsÿÿÿÿÿÿ:ÿasbalanced

          -----------------------------------------------------------
          ÿÿÿÿÿÿÿÿÿÿÿÿÿ|ÿÿÿÿÿÿÿÿÿdfÿÿÿÿÿÿÿÿddfÿÿÿÿÿÿÿÿÿÿÿFÿÿÿÿÿÿÿÿP>F
          -------------+---------------------------------------------
          iopÿÿÿÿÿÿÿÿÿÿ|
          ÿÿÿÿÿÿÿÿÿtrtÿ|ÿÿÿÿÿÿÿÿÿÿ1ÿÿÿÿÿÿ27.82ÿÿÿÿÿÿÿÿ1.59ÿÿÿÿÿ0.2173
          ÿÿÿÿÿÿÿÿÿÿÿÿÿ|
          ÿÿÿÿÿÿÿÿÿsidÿ|ÿÿÿÿÿÿÿÿÿÿ1ÿÿÿÿÿÿ20.27ÿÿÿÿÿÿÿÿ2.46ÿÿÿÿÿ0.1320
          ÿÿÿÿÿÿÿÿÿÿÿÿÿ|
          ÿÿÿÿÿtrt#sidÿ|ÿÿÿÿÿÿÿÿÿÿ1ÿÿÿÿÿÿ20.27ÿÿÿÿÿÿÿÿ0.01ÿÿÿÿÿ0.9155
          -----------------------------------------------------------

          .ÿ
          .ÿexit

          endÿofÿdo-file


          .


          In any case, you probably wouldn't be using GEE with a total of 30 patients.

          Comment

          Working...
          X