MedSurvey (version 1.0)

med.p.adjust: To adjust the p values for multimediation tests

Description

This function is used to adjust the p values when there are multiple mediators (Mai et al., 2019).

Usage

med.p.adjust(fit = NULL, med.eff = NULL, p.adj.method = c("holm",
  "hochberg", "hommel", "bonferroni", "BH", "BY", "fdr"))

Arguments

fit

The model fit results of a model with multiple mediators. Note that it is a lavaan object.

med.eff

A vector of labels. The labels should be of the mediation effects in the estimated model.

p.adj.method

The method used to adjust for multiplicity ('holm' or 'hochberg' or 'hommel' or 'bonferroni' or 'BH' or 'BY' or 'fdr'). Conservative method includes the Bonferroni correction ('bonferroni') in which the p-values are multiplied by the number of comparisons. Less conservative corrections are also included by Holm (1979) ('holm'), Hochberg (1988) ('hochberg'), Hommel (1988) ('hommel'), Benjamini & Hochberg (1995) ('BH' or its alias 'fdr'), and Benjamini & Yekutieli (2001) ('BY'), respectively. It is 'holm' by default. It is not required.

Value

The adjusted p values along with the effect labels and original p values. It is a list.

References

Benjamini, Y., & Hochberg, Y. (1995). Controlling the false discovery rate: a practical and powerful approach to multiple testing. Journal of the Royal Statistical Society Series B, 57, 289<U+2013>300. DOI:10.2307/2346101

Benjamini, Y., & Yekutieli, D. (2001). The control of the false discovery rate in multiple testing under dependency. Annals of Statistics, 29, 1165<U+2013>1188. DOI:10.1214/aos/1013699998

Holm, S. (1979). A simple sequentially rejective multiple test procedure. Scandinavian Journal of Statistics, 6, 65<U+2013>70.

Hommel, G. (1988). A stagewise rejective multiple test procedure based on a modified Bonferroni test. Biometrika, 75, 383<U+2013>386. DOI:10.1093/biomet/75.2.383

Hochberg, Y. (1988). A sharper Bonferroni procedure for multiple tests of significance. Biometrika, 75, 800<U+2013>803. DOI:10.1093/biomet/75.4.800

Rosseel, Y. (2012). Lavaan: An R package for structural equation modeling and more. Version 0.5<U+2013>12 (BETA). Journal of statistical software, 48(2), 1-36. DOI:10.18637/jss.v048.i02

Shaffer, J. P. (1995). Multiple hypothesis testing. Annual Review of Psychology, 46, 561<U+2013>576.

Sarkar, S. (1998). Some probability inequalities for ordered MTP2 random variables: a proof of Simes conjecture. Annals of Statistics, 26, 494<U+2013>504. DOI:10.1214/aos/1028144846

Examples

Run this code
# NOT RUN {
R <- 160
wgtnames <- paste("repwgt", seq(0,R,by=1), sep="")
mwgtname=wgtnames[1]
repwgtnames=wgtnames[2:(R+1)]
fayfactor=0.5

model2 <- ' # outcome
              numcg ~ u0*1 + c*workban + b1*sp_adltban + b2*sp_kidsban
            # mediator
              sp_adltban ~ u1*1 + a1*workban
              sp_kidsban ~ u2*1 + a2*workban
            #covariance of residuals
              sp_adltban ~~ sp_kidsban
            # indirect effect (a*b)
              a1b1 := a1*b1
              a2b2 := a2*b2
            # total effect
              total := c + (a1*b1) + (a2*b2)
           '
fit.BRR2 <- med.fit.BRR(model=model2, data=MedData, mwgtname=mwgtname,
             repwgtnames=repwgtnames, fayfactor)
temp <- med.p.adjust(fit=fit.BRR2, med.eff=c('a1b1' , 'a2b2'))
#
# Adjustment for multi mediation tests:
#
#      Effect          p Value      adj.p Value
#       a1b1      0.003667674      0.007335347
#       a2b2      0.217228711      0.217228711
#
# NOTE: 	 p Value adjustment method is holm
#
#########################################
# To catch the unformatted results:
temp
#
# $med.eff
# [1] "a1b1" "a2b2"
#
# $org.p.value
# [1] 0.003667674 0.217228711
#
# $adj.p.value
# [1] 0.007335347 0.217228711
# }

Run the code above in your browser using DataLab