Dear Statalist members,
I struggle with calculating p-values for bias-corrected confidence intervals after I run a mediation analysis with bootstrapping. Unfortunately, Stata 17 only shows z and p-values for normal based confidences intervals and not for bias-corrected CIs. The issue should be applicable to other statistical models using bootstrap (e.g., regressions, see this thread for basically the same issue).
Mediation with 60 bootstrap replications showing an insignificant link between Mediator 1 and Mediator 2 based on normal confidence intervals (M1 -> M2, relevant line is colered in red)
Bias-corrected confidence intervals for the above analysis, showing that the link between M1 -> M2 should be significant at the 10% level (colered in orange)
60 replications are simply chosen for illustration purposes, since the normal based CI p-value is above 10% in this case, whereas the bias-corrected p-value should be < 10%.
I tried the recommendation in this older thread by taking the observed coefficient minus the bias to calculate a z value and then taking 2*normal(-abs(‘z’)) for the p-value. However, this yields a p-value of 0.139 when it actually should be < 0.10 [using di 2*normal(-abs((2.0807463 - .1086629) / 1.3343272))] since the bias-corrected confidence interval range does not contain zero at the 90% confidence level.
Bruteforcing the confidence level shows that the p-value should be between a significance level of 90.4 and 90.5%.
I assume that the solution goes into the direction of this paper, which currently is above the scope of my knowledge.
For brevity, I didn't attach the dataex code. If it helps, I can attach it.
Many thanks for your valuable help,
Hannes
I struggle with calculating p-values for bias-corrected confidence intervals after I run a mediation analysis with bootstrapping. Unfortunately, Stata 17 only shows z and p-values for normal based confidences intervals and not for bias-corrected CIs. The issue should be applicable to other statistical models using bootstrap (e.g., regressions, see this thread for basically the same issue).
Mediation with 60 bootstrap replications showing an insignificant link between Mediator 1 and Mediator 2 based on normal confidence intervals (M1 -> M2, relevant line is colered in red)
Code:
. sem (X -> Y, ) (X -> M2, ) (M2 -> M1, ) (M1 -> Y, ), vce(bootstrap, reps(60) seed(2) dots(1)) level(90) nocapslatent
(running sem on estimation sample)
Bootstrap replications (60)
Structural equation model Number of obs = 114
Estimation method: ml Replications = 60
Log likelihood = -937.89911
------------------------------------------------------------------------------
| Observed Bootstrap Normal-based
| coefficient std. err. z P>|z| [90% conf. interval]
-------------+----------------------------------------------------------------
Structural |
-----------+----------------------------------------------------------------
M1 |
M2 | 2.080746 1.334327 1.56 0.119 -.1140266 4.275519
_cons | 60.87975 4.511078 13.50 0.000 53.45969 68.29981
------------------------------------------------------------------------------
Code:
. estat bootstrap, bc
Structural equation model Number of obs = 114
Replications = 60
------------------------------------------------------------------------------
| Observed Bootstrap
| coefficient Bias std. err. [90% conf. interval]
-------------+----------------------------------------------------------------
M1 |
M2 | 2.0807463 .1086629 1.3343272 .0238429 4.09717 (BC)
_cons | 60.879751 .078569 4.5110779 53.49619 68.20156 (BC)
------------------------------------------------------------------------------
Key: BC: Bias-corrected
I tried the recommendation in this older thread by taking the observed coefficient minus the bias to calculate a z value and then taking 2*normal(-abs(‘z’)) for the p-value. However, this yields a p-value of 0.139 when it actually should be < 0.10 [using di 2*normal(-abs((2.0807463 - .1086629) / 1.3343272))] since the bias-corrected confidence interval range does not contain zero at the 90% confidence level.
Bruteforcing the confidence level shows that the p-value should be between a significance level of 90.4 and 90.5%.
I assume that the solution goes into the direction of this paper, which currently is above the scope of my knowledge.
For brevity, I didn't attach the dataex code. If it helps, I can attach it.
Many thanks for your valuable help,
Hannes
Comment