sim_design() generates a data table with a specified within and between design.

sim_design(within = list(), between = list(), n = 100, mu = 0,
  sd = 1, r = 0, empirical = FALSE, long = FALSE, dv = list(y =
  "value"), id = list(id = "id"), plot = faux_options("plot"),
  seed = NULL, interactive = FALSE, design = NULL, rep = 1)

Arguments

within

a list of the within-subject factors

between

a list of the between-subject factors

n

the number of samples required

mu

the means of the variables

sd

the standard deviations of the variables

r

the correlations among the variables (can be a single number, full correlation matrix as a matric or vector, or a vector of the upper right triangle of the correlation matrix

empirical

logical. If true, mu, sd and r specify the empirical not population mean, sd and covariance

long

Whether the returned tbl is in wide (default = FALSE) or long (TRUE) format

dv

the name of the dv for long plots (defaults to y)

id

the name of the id column (defaults to id)

plot

whether to show a plot of the design

seed

a single value, interpreted as an integer, or NULL (see set.seed)

interactive

whether to run the function interactively

design

a design list including within, between, n, mu, sd, r, dv, id

rep

the number of data frames to return (default 1); if greater than 1, the returned data frame is nested by rep

Value

a tbl