Skip to contents

Builds the design object used by power_curve(), design_term_means(), and simulate_design_dataset(). This object stores factor names, level counts, generated factor levels, and the between/within cell grids.

Usage

balanced_anova_design(between = NULL, within = NULL)

Arguments

between

Named integer vector of between-subject factor level counts, e.g. c(group = 2). Use NULL for no between-subject factors.

within

Named integer vector of within-subject factor level counts, e.g. c(time = 3). Use NULL for no within-subject factors.

Value

An object of class anovapowersim_design_spec.

Examples

d <- balanced_anova_design(between = c(group = 2), within = c(time = 3))
d$between_cells
#> # A tibble: 2 × 1
#>   group 
#>   <fct> 
#> 1 group1
#> 2 group2
d$within_cells
#> # A tibble: 3 × 1
#>   time 
#>   <fct>
#> 1 time1
#> 2 time2
#> 3 time3