Learn R Programming

powerMediation (version 0.3.4)

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

Description

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

Usage

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

Arguments

power

power for testing \(b_2=0\) for the cox regression \(\log(\lambda)=\log(\lambda_0)+b1 x_i + b2 m_i\), where \(\lambda\) is the hazard function and \(\lambda_0\) is the baseline hazard function.

b2

regression coefficient for the mediator \(m\) in the cox regression \(\log(\lambda)=\log(\lambda_0)+b1 x_i + b2 m_i\), where \(\lambda\) is the hazard function and \(\lambda_0\) is the baseline hazard function.

sigma.m

standard deviation of the mediator.

psi

the probability that an observation is uncensored, so that the number of event \(d= n * psi\), where \(n\) is the sample size.

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 \(b_2=0\) versus the alternative hypothesis \(b_2\neq 0\) for the cox regressions: $$\log(\lambda)=\log(\lambda_0)+b1 x_i + b2 m_i$$

Vittinghoff et al. (2009) showed that for the above cox regression, testing the mediation effect is equivalent to testing the null hypothesis \(H_0: b_2=0\) versus the alternative hypothesis \(H_a: b_2\neq 0\).

The full model is $$\log(\lambda)=\log(\lambda_0)+b_1 x_i + b_2 m_i $$

The reduced model is $$\log(\lambda)=\log(\lambda_0)+b_1 x_i $$

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.cox, powerMediation.VSMc.cox

Examples

Run this code
# NOT RUN {
  # example in section 6 (page 547) of Vittinghoff et al. (2009).
  # n = 1399
  ssMediation.VSMc.cox(power = 0.7999916, b2 = log(1.5), 
    sigma.m = sqrt(0.25 * (1 - 0.25)), psi = 0.2, corr.xm = 0.3,
    alpha = 0.05, verbose = TRUE)

# }

Run the code above in your browser using DataLab