3

This is a follow-up question on a prior thread about the same setup as follows:

We have two "Methods" ("A" and "B") to diagnose a medical condition. We are not trying to determine which one is better (accuracy, sensitivity and specificity). At this point we just want to know whether they result in a different proportion of positive results ("pos"). Like this:

 two_by_two<-matrix(c(240,186,272,302),nrow=2,byrow=T)
 dimnames(two_by_two) <- list(c("pos","neg"),c("pos","neg"))
 names(dimnames(two_by_two)) <-c("Method.A","Method.B")
 two_by_two

        Method.B
Method.A pos neg
     pos 240 186
     neg 272 302

So there are 1,000 individuals and we have looked at them with "Method.A" and "Method.B", tabulating the "pos" or positive results, and the "neg" or negative results for each individual and method.

I ran a McNemar's test on the data.

Now what I want to know is whether it makes conceptual sense to fit any regression models for matched or paired observations. For instance, Testing paired frequencies for independence is a great post with @chl introducing some really interesting code for ordinal quasi-symmetry (OQS). Unfortunately my data is hardly ordinal in any way. Agresti talks about marginal and conditional models for matched pairs. But again, it seems like my data is too basic to even contemplate a poisson glm model.

Any ideas? Any conceptual clarification (you can make it binary - yes/no)? Any code or leads to code?

1 Answers1

1

OK, then... It's either start a bounty, or think really hard, and continue with what seems to be a budding tradition of answering my own questions - hopefully it can help someone else out there. Picking up on Chris Novak's suggestion, here it goes:

tab<-data.frame(pair=rep(1:1000,rep(2,1000)), 
                Method.A=rep(c(1,0),1000), 
                pos=c(rep(c(1,1),240),rep(c(1,0),186),
                rep(c(0,1),272),rep(c(0,0),302)))

In this way the table created would behave as follows... Let's call on tab[849:856,]:

    pair Method.A pos
849  425        1   1
850  425        0   0
851  426        1   1
852  426        0   0
853  427        1   0
854  427        0   1
855  428        1   0
856  428        0   1

The "pos" column transitions after pair 426 from 1 - 0, 1 - 0 to 0 - 1, 0 - 1. The first pattern aligns the "1's" in the "Method.A" column with the "1's" in the "pos" column. The "Method.A" acts as a dummy variable, and "counts" the positives in the second cell of the contingency table (positive Method.A / negative Method.B). After pair 427 we are in the third cell, where Method.A is negative, and that is coded in the offset between the "1's" in "Method.A" and "pos" columns.

Following this, we can apply the suggested conditional logistic regression clogit in the package {survival} with the results:

fit<-clogit(Method.A ~ pos + strata(pair), method = "exact", data=tab)
Call:
coxph(formula = Surv(rep(1, 2000L), Method.A) ~ pos + strata(pair), 
    data = tab, method = "exact")

  n= 2000, number of events= 1000 

        coef exp(coef) se(coef)      z Pr(>|z|)    
pos -0.38006   0.68382  0.09515 -3.994 6.48e-05 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

    exp(coef) exp(-coef) lower .95 upper .95
pos    0.6838      1.462    0.5675     0.824

Rsquare= 0.008   (max possible= 0.5 )
Likelihood ratio test= 16.24  on 1 df,   p=5.566e-05
Wald test            = 15.96  on 1 df,   p=6.485e-05
Score (logrank) test = 16.15  on 1 df,   p=5.857e-05

So now I only need to interpret these results. To do this, I just changed the values in the table randomly (I don't have some elegant code with for loop, but it would be welcome), realizing that the exp(coef) in the output of clogit fulfills:

        Method.B
Method.A pos neg
     pos  a  b
     neg  c  d

$exp(coef) = b/c = odds\,ratio\,McNemar's\,exact\,test.$

And the interpretation would be the odds ratio of the odds of getting a positive result with Method.A conditioned on Method.B being negative ($b/d$) over the odds of obtaining a positive results with Method.B conditioning on Method.A being negative ($c/d$), which nicely returns the ratio of $b/c$.

So clogit in this very peculiar setting may be equivalent to performing a mcnemar.exact {exact2x2}(?).