# Sample size calculation for continuous endpoints
param_grid <- expand.grid(
delta1 = c(0.3, 0.5),
delta2 = c(0.1, 0.2, 0.3),
sd1 = c(1.0, 1.5),
sd2 = c(1.0, 1.5)
)
result <- design_table(
param_grid = param_grid,
rho_values = c(0, 0.3, 0.5, 0.8),
r = 1,
alpha = 0.025,
beta = 0.2,
endpoint_type = "continuous"
)
print(result)
# Power calculation for continuous endpoints
param_grid_power <- expand.grid(
n1 = c(50, 100),
n2 = c(50, 100),
delta1 = 0.5,
delta2 = 0.5,
sd1 = 1.0,
sd2 = 1.0
)
result_power <- design_table(
param_grid = param_grid_power,
rho_values = c(0, 0.3, 0.5, 0.8),
alpha = 0.025,
endpoint_type = "continuous"
)
print(result_power)
# Binary endpoints
param_grid_binary <- expand.grid(
p11 = c(0.6, 0.7),
p12 = c(0.4, 0.5),
p21 = c(0.4, 0.5),
p22 = c(0.2, 0.3)
)
result_binary <- design_table(
param_grid = param_grid_binary,
rho_values = c(0.3, 0.5, 0.7),
r = 1,
alpha = 0.025,
beta = 0.2,
endpoint_type = "binary",
Test = "AN"
)
print(result_binary)
Run the code above in your browser using DataLab