View source: R/twoway_simultesting.R
twoway_simulation_testing | R Documentation |
This functions takes the output of either the twoway_simulation_independent
or the twoway_simulation_correlated
functions
and calculates the power of the sample size used in the simulation under parametric analysis of variance, rank based analysis of variance or
permutation testing.
twoway_simulation_testing(data, test = "ANOVA", alpha = 0.05)
data |
|
test |
|
alpha |
|
A data.frame
with the power and 95% confidence interval for each of the main effects and their interaction.
## After creating a 'matrices_obj' with the 'calculate_mean_matrix' function.
refmean <- 1
treatgroups <- 4
timepoints <- 5
treateff <- 1.5
timeeff <- 0.85
rho <- 0.8
withinf <- "fB"
factors_levels_names <- list(treatment=letters[1:treatgroups], time=1:timepoints)
effects_treat_time <- calculate_mean_matrix(refmean = refmean,
fAeffect = treateff, fBeffect = timeeff,
nlfA = treatgroups, nlfB = timepoints,
rho = rho, withinf = withinf,
label_list = factors_levels_names)
n <- 7
correlated_sim <- twoway_simulation_correlated(group_size=n, matrices_obj=effects_treat_time,
nsims=20)
##used smaller number of iterations to reduce computation time
twoway_simulation_testing(correlated_sim)
## defaults to parametric analysis of variance
twoway_simulation_testing(correlated_sim, test="rank")
## rank based analysis of variance
## permutation test is another option
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.