Adjusting post-hoc p-values for PLANNED comparisons

Everything related to the development of modules in jamovi
Post Reply
ProtonEnergy
Posts: 7
Joined: Sun Sep 15, 2024 6:44 am

Adjusting post-hoc p-values for PLANNED comparisons

Post by ProtonEnergy »

In the post-hoc sections of ANOVA and Linear models there are multiple options for post-hoc tests (Bonferroni, Tukey HSD and so on). However there is no possible correction for PLANNED comparisons.

For example, currently i'm running a rmANOVA (and comparing the results to a LMM) that has a total number of comparisons of 190 but only 10 of those make sense according to the research question and therefore the number of planned comparisons = 10.

Manually adjusting the bonferroni correction is very simple, but other tests eg Tukey's HSD require more inputs and a little more complicated calculations.

Would it be possible to create a check box + data entry (number of planned comparisons when fewer than total possible) in the post-hoc sections so the appropriate p-value adjustment is generated?
ProtonEnergy
Posts: 7
Joined: Sun Sep 15, 2024 6:44 am

Re: Adjusting post-hoc p-values for PLANNED comparisons

Post by ProtonEnergy »

quick follow up here....

In the event an uncorrected post-hoc p value is < 0.001 then obviously, even a simple planned comparison bonferroni correction becomes more complicated without knowing the exact p value.
User avatar
reason180
Posts: 344
Joined: Mon Jul 24, 2017 4:56 pm

Re: Adjusting post-hoc p-values for PLANNED comparisons

Post by reason180 »

FYI.
(#1) You ca get 'exact' p values by selecting the three-dot icon in the upper right of the jamovi interface and changing number of decimal places for the 'p value format.'
(#2) I think that specifying the number of comparisons would only work for some kinds of planned comparisons. The Holm correction, for example, is sensitive to the particular set of p values and not just to the number of p values.
User avatar
reason180
Posts: 344
Joined: Mon Jul 24, 2017 4:56 pm

Re: Adjusting post-hoc p-values for PLANNED comparisons

Post by reason180 »

#3 An already-available, semi-automated solution is to use jamovi's Rj module to run code something like the following:

Code: Select all

# This code computes the Holm-corrected p values for a vector of 
# uncorrected p values. (Options besides "holm" are: 
# "hochberg", "hommel", "bonferroni", "BH", "BY", and "fdr".)
#
p.adjust(c(.027, .141, .018, .053), "holm")  
#
# output: [1] 0.081 0.141 0.072 0.106
ProtonEnergy
Posts: 7
Joined: Sun Sep 15, 2024 6:44 am

Re: Adjusting post-hoc p-values for PLANNED comparisons

Post by ProtonEnergy »

reason180 wrote: Tue Jul 22, 2025 12:59 am #3 An already-available, semi-automated solution is to use jamovi's Rj module to run code something like the following:

Code: Select all

# This code computes the Holm-corrected p values for a vector of 
# uncorrected p values. (Options besides "holm" are: 
# "hochberg", "hommel", "bonferroni", "BH", "BY", and "fdr".)
#
p.adjust(c(.027, .141, .018, .053), "holm")  
#
# output: [1] 0.081 0.141 0.072 0.106
Hi thanks for replying. That's excellent feedback about the exact p value and also the p.adjust r function. Will give it a try in Rj module
Post Reply