3
$\begingroup$

I have the following count and denominator information. The 630 subjects are the same people over two different periods of time. Can I conduct a McNemar's test to compare the dependent proportion difference?

enter image description here

Or does it have to be in a 2x2 table format like this, where I need to calculate a, b, c, d first?

enter image description here

$\endgroup$
  • $\begingroup$ Do you know any of a, b, c, or d? $\endgroup$ – gung Mar 20 at 20:29
  • 1
    $\begingroup$ It can be extracted but will require significant amount of time. I know if we know just one of these values, all 4 will be solvable. So let's assume, we don't know any of them, can I still run a McNemar's test, and if not, are there other tests I can use? $\endgroup$ – KubiK888 Mar 20 at 20:32
2
$\begingroup$

You need to have b and c. A 2x2 table has only 1 degree of freedom, meaning that if you were able to determine any of the cells, you could figure out the rest. Fortunately for you, the sum of no condition A during the follow-up period is just 5. That means you can quite easily determine the possible results by brute force. You wouldn't know which is correct, but since all are highly significant, it might be enough for you. Here is an example, coded in R (a lot of output is omitted to shorten what's pasted here):

b = as.list(0:5)
tab.fun = function(b){
  d = 5-b
  a = 600-b
  c = 30-d
  tab = as.table(rbind(c(a, b),
                       c(c, d)) )
  return(tab)
}
lapply(b, function(l){ 
            list(addmargins(tab.fun(l)), mcnemar.test(tab.fun(l))) })
# [[1]][[1]]
#       A   B Sum
# A   600   0 600
# B    25   5  30
# Sum 625   5 630
# [[1]][[2]]
# McNemar's chi-squared = 23.04, df = 1, p-value = 1.587e-06
# 
# [[2]][[1]]
#       A   B Sum
# A   599   1 600
# B    26   4  30
# Sum 625   5 630
# [[2]][[2]]
# McNemar's chi-squared = 21.333, df = 1, p-value = 3.86e-06
# 
# [[3]][[1]]
#       A   B Sum
# A   598   2 600
# B    27   3  30
# Sum 625   5 630
# [[3]][[2]]
# McNemar's chi-squared = 19.862, df = 1, p-value = 8.324e-06
# 
# [[4]][[1]]
#       A   B Sum
# A   597   3 600
# B    28   2  30
# Sum 625   5 630
# [[4]][[2]]
# McNemar's chi-squared = 18.581, df = 1, p-value = 1.629e-05
# 
# [[5]][[1]]
#       A   B Sum
# A   596   4 600
# B    29   1  30
# Sum 625   5 630
# [[5]][[2]]
# McNemar's chi-squared = 17.455, df = 1, p-value = 2.943e-05
# 
# [[6]][[1]]
#       A   B Sum
# A   595   5 600
# B    30   0  30
# Sum 625   5 630
# [[6]][[2]]
# McNemar's chi-squared = 16.457, df = 1, p-value = 4.976e-05
$\endgroup$
  • $\begingroup$ Do you happen to know if there is valid statistical test that doesn't require it? I found this but it has no citation of the method used - home.ubalt.edu/ntsbarsh/business-stat/otherapplets/… $\endgroup$ – KubiK888 Mar 20 at 20:58
  • $\begingroup$ @KubiK888, I don't know what that is. I doubt it's valid. You can see that the p-values can vary based on the underlying pattern. In this case, you're just lucky that all possiblities will lead to the same statistical decision. $\endgroup$ – gung Mar 20 at 21:03
  • $\begingroup$ To understand, the brute force is basically like a sensitivity analysis to include all possible values within the range, and then summarize it altogether? $\endgroup$ – KubiK888 Mar 20 at 21:09
  • $\begingroup$ @KubiK888, "brute force" means this is all the possibilities that can exist. You wouldn't try to combine them, unless you want to use a Bayesian method for that. If I were writing a scientific paper for publication, I would just explain that, whatever the underlying table looks like, these data have to show a significant change. You could give the ranges for the chi-squared statistic & the p-value. $\endgroup$ – gung Mar 20 at 21:25
  • $\begingroup$ Nice solution. @KubiK888, you might also look at the odds ratio or Cohen's g for these tables. The odds ratio for the McNemar case can be defined as c / b [or b / c, as makes sense for the specific case]. Here it looks like the minimum odds ratio is 6 [30 / 5], and the maximum is infinity [25 / 0]. $\endgroup$ – Sal Mangiafico Mar 23 at 13:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.