# Example parameters for comparison across methods
n1_ex <- 100
n2_ex <- 100
delta1_ex <- 0.5
delta2_ex <- 0.5
sd1_ex <- 1
sd2_ex <- 1
rho_ex <- 0.3
alpha_ex <- 0.025
# Power calculation with known variance
power2Continuous(
n1 = n1_ex,
n2 = n2_ex,
delta1 = delta1_ex,
delta2 = delta2_ex,
sd1 = sd1_ex,
sd2 = sd2_ex,
rho = rho_ex,
alpha = alpha_ex,
known_var = TRUE
)
# \donttest{
# Power calculation with unknown variance (Monte Carlo)
power2Continuous(
n1 = n1_ex,
n2 = n2_ex,
delta1 = delta1_ex,
delta2 = delta2_ex,
sd1 = sd1_ex,
sd2 = sd2_ex,
rho = rho_ex,
alpha = alpha_ex,
known_var = FALSE,
nMC = 10000
)
# }
Run the code above in your browser using DataLab