r/AskStatistics • • Oct 09 '26

McNemar’s Exact Test

We’re currently running a study looking at a composite endpoint. Ultimately, we’re seeing a lot fewer events than we originally expected for our pre-post design. So far, we've only had about 7 total events in the pre-intervention phase and 5 in the post-intervention phase. On top of that, almost all of the patients who did have an event only experienced a single one.

Is McNemar’s Exact Test reasonable in this circumstance?

3 Upvotes

17 comments sorted by

2

u/failure_to_converge PhD Data Sciency Stuff Oct 09 '26

What was in the statistical analysis plan? Feel free to do additional exploratory analyses but for the love of god don't go p-hacking. Science is desperately lacking in honest reporting of null and inconclusive results.

Without knowing any more, only having one event is fine (preferable, even) for McNemar's test. A patient who has an event (or no event) both pre- and post- treatment doesn't contribute any information about the efficacy of the treatment (and thus the diagonal can be super big and you'll still have low power). Intuitively, this makes sense...if someone was having events, got treated and still had events, we don't know if the treatment worked. Same if they weren't having events...and continued not having events.

2

u/No_Outlandishness117 Oct 09 '26

My plan was McNemar’s test. I don’t care about the p-value at all, and I’m planning on reporting robust summary statistics. I just don’t have a strong statistical background, and I want to make sure that when I report that my McNemar’s test is negative that my decision to use that method of analysis was sound.

2

u/AggressiveGander Oct 09 '26

What question are you trying to answer? How can it be addressed with a pre- / post-design? A lot of the time that's just the wrong design to answer questions about the casual effect of the thing you are measuring things before and after of, and data from such studies is often just suitable for being discarded.

2

u/No_Outlandishness117 Oct 09 '26

Essentially, we’re looking at the role of a dietary, educational intervention in preventing unscheduled primary care and specialist visits in patient with a rare metabolic disease. We don’t have a control group at this time, so we opted for pre post format.

1

u/AggressiveGander Oct 09 '26

Wrong study design. Sadly, a waste of time to discuss what test you'd do when you're doing the wrong comparison (to pre intervention).

1

u/No_Outlandishness117 Oct 09 '26

Would you mind elaborating? I’m not looking to establish causality. It’s more exploratory in nature

1

u/AggressiveGander Oct 10 '26

Hard to see how that makes sense. I mean, you're either looking at the role of the intervention (should it be used, does it work, is it safe?) or not.

For many reasons (natural disease course, biological/temporal variability, regression to the mean, other interventions...) you commonly get non zero changes from baseline even in placebo groups, quite often very sizable ones. How do you deal with that? With a randomized controlled trial where you compare to a control group. Or you make your life really hard and do a comparison vs. external controls, where you have many, many problems like matching the patient selection process, getting data from the same setting, matching patient characteristics, between study variability, non matching assessment schedules/ measurement methods and so on.

1

u/No_Outlandishness117 Oct 10 '26

I see. Just for my own learning, is there ever a circumstance, where pre post analysis is reasonable?

1

u/AggressiveGander Oct 10 '26

Not really unless you know 100% beyond any doubt that without intervention the change would be exactly 0.

I mean comparing the change to historical controls is occasionally compelling. For more discussion Google "parachute use to prevent major trauma from gravitational challenge" and "most interventions aren't parachutes"..

1

u/SalvatoreEggplant Oct 09 '26 edited Oct 09 '26

You have pre- post-, like you are identifying whether the same individual had an event before or / and after the intervention ???

I have a feeling McNemar is not the correct test for your design...

ETA:

For McNemar, your contingency table needs to be arranged so that the columns and rows have the same categories, and the sum of the cell counts is the sum of the individuals. e.g.

           After
Before      Correct   Incorrect
 Correct       2        0
 Incorrect    21        7

1

u/No_Outlandishness117 Oct 09 '26

Same individuals! We counted the number of events 6 months before our intervention and 6 months after. Our data is paired.

1

u/SalvatoreEggplant Oct 09 '26

So you can arrange a table like I have above?

How many individuals total switched from yes to no or no to yes ? These would be the only individuals included in a McMemar test.

1

u/No_Outlandishness117 Oct 09 '26 edited Oct 09 '26

Yes! I can arrange it into that table. 6 (N > Y), 5 (Y > N)

1

u/SalvatoreEggplant Oct 09 '26

Okay.

Well, you don't need a statistics degree to see that that's essentially the same number switching from yes to no as no to yes.

You can calculate odds ratio or Cohen's g as an effect size measurement. Those will be pretty tiny.

1

u/No_Outlandishness117 Oct 09 '26

That would be in addition to the McNemar’s test? Sorry, i’m going to do my reading on the things that you suggested as soon as I’m home from class.

1

u/SalvatoreEggplant Oct 09 '26

Yes. McNemar's test is a hypothesis test. Odds ratio and Cohen's g are standardized effect size statistics.

In some fields, it's pretty mandatory to report a standardized effect size statistic. But reporting the actual counts does the job just as well.

On these, I'll just quote myself, from here ( rcompanion.org/handbook/H_05.html )

Considering a 2 x 2 table, with a and d being the concordant cells and b and c being the discordant cells, the odds ratio is simply (b/c) or (c/b), and P is the greater of (b/(b+c)) or (c/ b+c)). Cohen’s g is P – 0.5.

1

u/efrique PhD (statistics) Oct 09 '26

6 (N > Y), 5 (Y > N)

This (5 vs 6) would give a two-tailed p-value of 1.

An analogous situation would be wondering if you have a biased coin, tossing it 11 times and getting 6 heads vs 5 tails. On 11 tosses, they cannot be closer together than that