Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bonferroni Correction to ttest

    Is there a way of incorporating a Bonferroni Correction in the ttest command e.g.
    Code:
      
    ttest BRIER_WTN = BRIER_Rank
    or do I need to manually apply the correction using the 0.05/number of comparisons to the p-values?

    I have 3 comparisons
    Code:
      
    ttest BRIER_WTN = BRIER_Rank
    ttest BRIER_WTN = BRIER_UTR
    ttest BRIER_UTR = BRIER_Rank
    So its not a huge ordeal
    Last edited by Lucas Kiely; 29 Jul 2024, 16:07.

  • #2
    Originally posted by Lucas Kiely View Post
    . . . . do I need to manually apply the correction using the 0.05/number of comparisons to the p-values? I have 3 comparisons . . .So its not a huge ordeal
    That would probably be your fastest, but if you wanted an official pretty printout, then you could do something like the following
    Code:
    rename (BRIER_WTN BRIER_Rank BRIER_UTR) (bri#), addnumber(0)
    generate `c(obs_t)' row = _n
    quietly reshape long bri, i(row) j(typ)
    
    label define Types 0 BRIER_WTN 1 BRIER_Rank 2 BRIER_UTR
    label values typ Types
    
    xtreg bri i.typ, i(row) fe
    
    pwcompare typ, pveffects  mcompare(bonferroni)
    which would give identical results to your pairwise series of Student's t-tests with Bonferroni adjustment.

    Comment


    • #3
      Originally posted by Joseph Coveney View Post
      . . . which would give identical results to your pairwise series of [paired] Student's t-tests with Bonferroni adjustment.
      I take that back: xtreg , fe will pool the errors and so won't be exactly the same.

      If you want to follow the three paired Student's t-tests exactly, then you could do the following.
      Code:
      generate byte k = 1
      
      manova BRIER_WTN BRIER_Rank BRIER_UTR = k, noconstant
      
      margins , pwcompare(pveffects) mcompare(bonferroni)

      Comment


      • #4
        Thank you, that worked well

        Comment

        Working...
        X