2017-08-02
simglm
packagepower.t.test, power.anova.test
plot of chunk visualize
simglm
Featuressimglm
Features Continuedsimglm
library(simglm)
fixed <- ~ 1 + trt_f
fixed_param <- c(0, 0.15)
fact_vars <- list(numlevels = 2, var_type = 'single',
opts = list(list(replace = TRUE)))
n <- NULL
error_var <- 1
with_err_gen <- 'rnorm'
pow_param <- c('(Intercept)', 'I(trt_f - 1)')
alpha <- .05
pow_dist <- "t"
pow_tail <- 2
replicates <- 500
terms_vary <- list(n = seq(20, 2000, 40))
power_out <- sim_pow(fixed = fixed, fixed_param = fixed_param, cov_param = NULL,
n = n, error_var = error_var, with_err_gen = with_err_gen,
fact_vars = fact_vars,
data_str = "single", pow_param = pow_param, alpha = alpha,
pow_dist = pow_dist, pow_tail = pow_tail,
replicates = replicates, terms_vary = terms_vary,
raw_power = FALSE, lm_fit_mod = sim_data ~ I(trt_f - 1))
plot of chunk power_out_figure
terms_vary <- list(n = seq(20, 2000, 40),
fact_vars = list(list(numlevels = 2, var_type = 'single',
opts = list(list(replace = TRUE))),
list(numlevels = 2, var_type = 'single',
opts = list(list(replace = TRUE,
prob = c(.7, .3))))))
pow_param <- c('I(trt_f - 1)')
power_out <- sim_pow(fixed = fixed, fixed_param = fixed_param, cov_param = NULL,
n = n, error_var = error_var, with_err_gen = with_err_gen,
fact_vars = fact_vars,
data_str = "single", pow_param = pow_param, alpha = alpha,
pow_dist = pow_dist, pow_tail = pow_tail,
replicates = replicates, terms_vary = terms_vary,
raw_power = FALSE, lm_fit_mod = sim_data ~ I(trt_f - 1))
plot of chunk power_factor