Announcement

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

  • Is there a way of tackling this lack of independence?

    Hi there

    The code below is looking at statin prescribing, comparing the quarters (Q3 15_16 vs Q4 17_18), with the purpose of comparing the proportion of statin use. How do I tackle the issue of independence, since some patients may have been prescribed statins and therefore feature in both quarters?

    Or is there another way of doing this?


    Code:
    logistic statins sex i.age_cats i.ethnicity  i.quarter  ckdcoded diabetes ht
    
    Logistic regression                             Number of obs     =      8,870
                                                    LR chi2(12)       =    1480.58
                                                    Prob > chi2       =     0.0000
    Log likelihood = -3633.7598                     Pseudo R2         =     0.1692
    
    ------------------------------------------------------------------------------
         statins | Odds Ratio   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
             sex |   1.430567   .0881596     5.81   0.000     1.267805    1.614225
                 |
        age_cats |
              1  |   2.461522   .2466796     8.99   0.000     2.022559    2.995755
              2  |    3.43512   .3278322    12.93   0.000     2.849097    4.141682
              3  |   2.155977   .1843237     8.99   0.000     1.823355    2.549277
                 |
       ethnicity |
              2  |   1.750865   .1348616     7.27   0.000     1.505526    2.036184
              3  |   .7583292   .0910975    -2.30   0.021     .5992438    .9596479
              4  |   .6565501    .112846    -2.45   0.014     .4687765    .9195387
              5  |    .623703   .1115415    -2.64   0.008     .4392898    .8855326
                 |
       1.quarter |   1.150593   .0685581     2.35   0.019     1.023771    1.293125
        ckdcoded |   1.468269   .1065803     5.29   0.000     1.273555    1.692753
        diabetes |   5.090672   .3915038    21.16   0.000      4.37837    5.918855
              ht |   2.244428   .1429742    12.69   0.000     1.980992    2.542898
           _cons |   .3457411   .0363643   -10.10   0.000     .2813348     .424892
    ------------------------------------------------------------------------------
    Look forward to your response.

    Thanks
    Vian

  • #2
    -help xtlogit-

    Comment


    • #3
      Thanks for your reply.

      When I cluster by practice:

      Code:
       xtlogit statins sex i.age_cats i.ethnicity  i.quarter  ckdcoded diabetes ht,   vce(cluster usualgpsorganisationcode)
      But STATA comes back with this - 'must specify panelvar; use xtset'

      I am not sure on the syntax here.

      Many thanks
      Vian

      Comment


      • #4
        Before you can use -xtlogit- (or any of the other -xt- commands) you must run an -xtset- command that specifies your panel (grouping) variable, and, optionally, a time variable. In your case you would have to run
        Code:
        xtset patient_id quarter
        where you replace patient_id by the name of the variable in your data set that identifies patients. (You can omit quarter--the time variable is not needed here for the kind of analyses you are planning.)

        By the way, a requirement for vce(cluster) in the -xt- series is that the clustering variable be constant within panels. In your case that means that each patient must have the same value of usualgpsorganisationcode in every observation for that patient.

        I will also note that if that is true, you may actually be dealing with 3-level data, not just 2. You've already acknowledged having repeated observations nested within patients. Are the patients then also nested within organizations? If so, you may need to go up to a three-level model. The -xt- commands only handle two levels, and you may be looking at using -melogit- instead.

        Comment


        • #5
          Many thanks Clyde this was very helpful

          Comment

          Working...
          X