Flash Sale | 50% off
Get 50% off unlimited learning

powerMediation (version 0.3.4)

ssMediation.VSMc.logistic: Sample size for testing mediation effect in logistic regression based on Vittinghoff, Sen and McCulloch's (2009) method

Description

Calculate sample size for testing mediation effect in logistic regression based on Vittinghoff, Sen and McCulloch's (2009) method.

Usage

ssMediation.VSMc.logistic(power, 
                          b2, 
                          sigma.m, 
                          p, 
                          corr.xm, 
                          n.lower = 1, 
                          n.upper = 1e+30, 
                          alpha = 0.05, 
                          verbose = TRUE)

Arguments

power

power for testing b2=0 for the logistic regression log(pi/(1pi))=b0+b1xi+b2mi.

b2

regression coefficient for the mediator m in the logistic regression log(pi/(1pi))=b0+b1xi+b2mi.

sigma.m

standard deviation of the mediator.

p

the marginal prevalence of the outcome.

corr.xm

correlation between the predictor x and the mediator m.

n.lower

lower bound for the sample size.

n.upper

upper bound for the sample size.

alpha

type I error rate.

verbose

logical. TRUE means printing sample size; FALSE means not printing sample size.

Value

n

sample size.

res.uniroot

results of optimization to find the optimal sample size.

Details

The test is for testing the null hypothesis b2=0 versus the alternative hypothesis b20 for the logistic regressions: log(pi/(1pi))=b0+b1xi+b2mi

Vittinghoff et al. (2009) showed that for the above logistic regression, testing the mediation effect is equivalent to testing the null hypothesis H0:b2=0 versus the alternative hypothesis Ha:b20.

The full model is log(pi/(1pi))=b0+b1xi+b2mi

The reduced model is log(pi/(1pi))=b0+b1xi

Vittinghoff et al. (2009) mentioned that if confounders need to be included in both the full and reduced models, the sample size/power calculation formula could be accommodated by redefining corr.xm as the multiple correlation of the mediator with the confounders as well as the predictor.

References

Vittinghoff, E. and Sen, S. and McCulloch, C.E.. Sample size calculations for evaluating mediation. Statistics In Medicine. 2009;28:541-557.

See Also

minEffect.VSMc.logistic, powerMediation.VSMc.logistic

Examples

Run this code
# NOT RUN {
  # example in section 4 (page 545) of Vittinghoff et al. (2009).
  # n=255

  ssMediation.VSMc.logistic(power = 0.80, b2 = log(1.5), sigma.m = 1, p = 0.5, 
    corr.xm = 0.5, alpha = 0.05, verbose = TRUE)

# }

Run the code above in your browser using DataLab