ANOVA_design: Design function used to specify the parameters to be used in...

View source: R/ANOVA_design.R

ANOVA_designR Documentation

Design function used to specify the parameters to be used in simulations


Design function used to specify the parameters to be used in simulations


  r = 0,
  label_list = NULL,
  labelnames = NULL,
  plot = Superpower_options("plot")



String specifying the ANOVA design.


Sample size in each condition


Vector specifying mean for each condition


standard deviation for all conditions (or a vector specifying the sd for each condition)


Correlation between dependent variables (single value or matrix)


An optional list to specify the factor names and condition (recommended, if not used factors and levels are indicated by letters and numbers).


Optional vector to specifying factor and condition names. This parameter is deprecated and will be overridden by input from label_list.


Should means plot be printed (defaults to TRUE)


Returns single list with simulated data, design, design list, factor names, formulas for ANOVA, means, sd, correlation, sample size per condition, correlation matrix, covariance matrix, design string, labelnames, labelnameslist, factor names, meansplot


A sample dataframe of what data could look like given the proposed parameters.


aov The design string, e.g. "2b*2w".


The list of variables in the design.


The first formula created for this design.


The second formula created for this design.


Vector of means.


Vector of standard deviations.


Common correlation coefficient.


Sample size per cell. Can be entered as a single value or list of sample sizes for each condition. If unequal n is entered then the design can only be passed onto ANOVA_power.


The correlation matrix.


The variance-covariance matrix.


Total number of within-subjects factors.


List of the label names.


Secondary list of labelnames


List of the factor titles.


Plot of the experimental design.


Varying the sd or r (e.g., entering multiple values) violates assumptions of homoscedascity and sphericity respectively


## Set up a within design with 2 factors, each with 2 levels,
## with correlation between observations of 0.8,
## 40 participants (who do all conditions), and standard deviation of 2
## with a mean pattern of 1, 0, 1, 0, conditions labeled 'condition' and
## 'voice', with names for levels of "cheerful", "sad", and "human", "robot"
ANOVA_design(design = "2w*2w", n = 40, mu = c(1, 0, 1, 0), sd = 2, r = 0.8,
      label_list= list(condition = c("cheerful", "sad"), 
      voice = c("human", "robot")))

Superpower documentation built on May 17, 2022, 5:08 p.m.