Announcement

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

  • Wilcoxon matched-pairs signed-ranks test for matched case control study?

    Hello,
    I am analysing an individually-matched case-control study (20 controls per one case), and I am trying to assess whether the median of the frequency of attending a clinic differs significantly between cases and controls. I have two variables: a binary variables (case vs. control) and a continues variable (number of attendance). I initially was thinking of using the Wilcoxon rank sum:

    ranksum totvisits, by(case)
    but then I read that given this is a matched case-control study, then I can't use the Wilcoxon rank sum but rather should use the Wilcoxon matched-pairs signed-ranks test. May I ask, how can I use that? I looked through STATA manual for signrank but couldn't figure out how to set my variables.
    Would the following be correct?
    signrank V1=V2
    where V1 and V2 refer to the total attendance of cases and controls, respectively.

    Please guide me.
    Last edited by Danah Abdul; 27 Aug 2022, 10:47.

  • #2
    your suggestion is correct. in the following example, we reject (at a 5% level) the null hypothesis that the distribution of V1 and V2 are the same,
    Code:
    . webuse fuel, clear
    
    . rename mpg* V*
    
    . signrank V1 = V2
    
    Wilcoxon signed-rank test
    
            Sign |      Obs   Sum ranks    Expected
    -------------+---------------------------------
        Positive |        3        13.5        38.5
        Negative |        8        63.5        38.5
            Zero |        1           1           1
    -------------+---------------------------------
             All |       12          78          78
    
    Unadjusted variance      162.50
    Adjustment for ties       -1.62
    Adjustment for zeros      -0.25
                         ----------
    Adjusted variance        160.62
    
    H0: V1 = V2
             z = -1.973
    Prob > |z| = 0.0485
    Exact prob = 0.0479
    see,
    Code:
    help signrank

    Comment


    • #3
      Øyvind Snilsberg many thanks and appreciation for your guidance.

      Comment


      • #4
        Øyvind Snilsberg
        Sorry for interruption.
        Regarding the question I previously asked, was going through my dataset and analysis, and there was an error using "signrank" as the total number of cases and the total number of controls are different.

        To elaborate, when I put this command:

        signrank V1=V2
        where V1 and V2 refer to the frequency of attendance of cases and controls, respectively.

        I have unequal number of observations in V1 and V2 because the cases and controls are matched 1:20.

        I get this error message:
        no observations
        I would appreciate your help.

        Comment


        • #5
          can you show the output of -sum V1 V2-?

          Comment


          • #6
            Øyvind Snilsberg Many thanks for your reply.

            sum V1
            14000 observation; min 0; max 250

            sum V2:
            280000 observations, min 0; max 331



            Comment


            • #7
              I presume your dataset looks like,
              Code:
              * Example generated by -dataex-. For more info, type help dataex
              clear
              input float(match V1 V2)
              1 5 .
              1 . 2
              1 . 2
              1 . 6
              1 . 8
              2 7 .
              2 . 4
              2 . 6
              2 . 8
              2 . 8
              end
              it should look like,
              Code:
              * Example generated by -dataex-. For more info, type help dataex
              clear
              input float(match V1 V2)
              1 5 4
              1 5 4
              1 5 6
              1 5 8
              2 7 4
              2 7 6
              2 7 8
              2 7 8
              end

              Comment


              • #8
                Øyvind Snilsberg
                I see, I got it! so all cases per matched group (of cases-control) would have a similar value to provide equal number of observations for cases and controls. Thank you, that makes sense.
                Thank you again for your help.
                Just a small question though, that wouldn't violate the condition of one-to-one matching for using the Wilcoxon matched-pairs signed-ranks test? (mine is 1:20 matching).

                Danah

                Comment


                • #9
                  Presuming this is truly a "case-control study," i.e., one in which case status is the outcome variable of interest, so that attending a clinic is a predictor of interest, I'd recommend against the use of the Wilcoxon here, as it would reverse the logical role of cause and effect, which can give misleading results. I'd use conditional logistic regression, perhaps with -bootstrap- to estimate the confidence intervals if there concerns about the validity of conventional CIs. There would be no problem with the 1:20 matching there.

                  If, on the other hand, you are interested in case status as a *cause* of clinic attendance, then this isn't a "case-control" study, which in standard usage denotes case status as the outcome. In that case, you could use a regression model with clinic attendance as the outcome, and with fixed or random effects for the matching variable. You could use -bootstrap- or -permute- for CIs or p-values to alleviate whatever concerns led to wanting to use the Wilcoxon in the first place.

                  Comment


                  • #10
                    Mike Lacy
                    Many thanks and appreciation for your elaboration.
                    I have assessed the risk of the outcome using conditional logistic regression (in which case the disease is the outcome and the total attendances were the predictors analysed categorically).
                    But my initial query was related to testing for statistical significance for differences in the average (median) number of attendances between cases and controls (in a 1:20 matched case control study)?

                    Comment

                    Working...
                    X