Hello,
My goal is to include regressions from the main analysis (X is my key regressors) as well as the heterogeneity analysis (using c.X#i.male) in the same wyoung command to account for multiple testing.
However, I did not succeed.
I tried with this data
It worked but still the results are weird. First, if I change the way I am writing the command, the results change while it should not. Second, the adjuted p-values are not adjsuted for the interaction term: c.mpg#c.rep78
My goal is to include regressions from the main analysis (X is my key regressors) as well as the heterogeneity analysis (using c.X#i.male) in the same wyoung command to account for multiple testing.
However, I did not succeed.
I tried with this data
Code:
sysuse auto.dta, clear
set seed 20
wyoung, cmd("reg price mpg" "reg price c.mpg#c.rep78") familyp(mpg c.mpg#c.rep78) bootstraps(100) seed(20)
local cmd1 reg price mpg
local cmd2 reg price c.mpg#c.rep78
wyoung, replace cmd("`cmd1'" "`cmd2'" ) familyp(mpg c.mpg#c.rep78) bootstraps(50) seed(20)
It worked but still the results are weird. First, if I change the way I am writing the command, the results change while it should not. Second, the adjuted p-values are not adjsuted for the interaction term: c.mpg#c.rep78
Code:
wyoung, cmd("reg price mpg" "reg price c.mpg#c.rep78") familyp(mpg c.mpg#c.rep78) bootstraps(100) seed(20)
Estimating family-wise adjusted p-values for 2 hypothesis tests
familyp: mpg
reg price mpg
familyp: c.mpg#c.rep78
reg price c.mpg#c.rep78
+------------------------------------------------------------------------------------------------------------------------------+
| k model outcome familyp coef stderr p pwyoung pbonf psidak |
|------------------------------------------------------------------------------------------------------------------------------|
1. | 1 reg price mpg price mpg -238.89435 53.076687 .00002546 0 .00005092 .00005092 |
2. | 2 reg price c.mpg#c.rep78 price c.mpg#c.rep78 -18.756467 8.987922 .04070956 .02 .04070956 .04070956 |
+------------------------------------------------------------------------------------------------------------------------------+
. local cmd1 reg price mpg
. local cmd2 reg price c.mpg#c.rep78
. wyoung, replace cmd("`cmd1'" "`cmd2'" ) familyp(mpg c.mpg#c.rep78) bootstraps(50) seed(20)
Estimating family-wise adjusted p-values for 2 hypothesis tests
familyp: mpg
reg price mpg
familyp: c.mpg#c.rep78
reg price c.mpg#c.rep78
+------------------------------------------------------------------------------------------------------------------------------+
| k model outcome familyp coef stderr p pwyoung pbonf psidak |
|------------------------------------------------------------------------------------------------------------------------------|
1. | 1 reg price mpg price mpg -238.89435 53.076687 .00002546 0 .00005092 .00005092 |
2. | 2 reg price c.mpg#c.rep78 price c.mpg#c.rep78 -18.756467 8.987922 .04070956 .04 .04070956 .04070956 |
+------------------------------------------------------------------------------------------------------------------------------+

Comment