The Stata command wyoung is updated to version 2.0 with new support for permutation-based resampling. Install with:
wyoung controls the family-wise error rate—the probability of rejecting at least one true null hypothesis—when testing multiple hypotheses that arise from considering multiple outcomes, subgroups, or parameters. This method leverages resampling techniques, such as bootstrapping (sampling with replacement) or permutation (shuffling), to adjust the standard p-values obtained from model estimation. The command also computes the Bonferroni-Holm and Sidak-Holm adjusted p-values. Detailed documentation, including simulation results, is available on Github. Syntax and usage instructions can be accessed directly in Stata by typing help wyoung at the command prompt.
Example. Perform the Westfall-Young adjustment using permutation with a stratified random sample (3 hypotheses).
Code:
ssc install wyoung, replace
Example. Perform the Westfall-Young adjustment using permutation with a stratified random sample (3 hypotheses).
Code:
sysuse auto.dta, clear set seed 20 gen stratum = floor(mpg/11) gen treat = foreign local yvars "mpg headroom turn" wyoung `yvars', cmd(regress OUTCOMEVAR treat) familyp(treat) permute(treat) strata(stratum) Estimating family-wise adjusted p-values for 3 hypothesis tests familyp: treat regress mpg treat regress headroom treat regress turn treat Performing 100 permutations... +------------------------------------------------------------------------------------------------------------------------+ | k model outcome familyp coef stderr p pwyoung pbonf psidak | |------------------------------------------------------------------------------------------------------------------------| 1. | 1 regress mpg treat mpg treat 4.9458042 1.3621621 .00052542 .08 .00105083 .00105056 | 2. | 2 regress headroom treat headroom treat -.54020979 .20708836 .01104863 .08 .01104863 .01104863 | 3. | 3 regress turn treat turn treat -6.0332168 .87394304 1.665e-09 0 4.994e-09 4.994e-09 | +------------------------------------------------------------------------------------------------------------------------+