# Using bonferroni with t.tests & regression

I have theoretical knowledge of why we should use bonferroni; however, unfortunately not how.

I am conducting multiple t.tests, sometimes within the main data (number of t.tests = 5, number of main tests/regression = 2), and sometimes within the split data by gender (number of tests = 2).

I am wondering then whether I should conduct bonferroni separately for the main data and the split data.

using R, finding the adjusted p using bonferroni for the main data is then:

p.adjust(c(0.0012, 0.005, 0.0464, 0.003, 0.0321, 0.001, 0.002), method = "bonferroni")


and the same for the split data would then be:

p.adjust(c(0.0464, 0.0321), method = "bonferroni")


Am I doing this correctly? Any help will be appreciated, thanks.

• And am I understanding it correctly that it is generally not preferred to do bonferroni on exploratory analyses? Thanks! – user240313 May 29 '19 at 18:03