if (FALSE) {
# modified example from runSimulation()
Design <- createDesign(N = c(10, 20),
SD = c(1, 2))
Design
# remove N=10, SD=2 row from initial definition
Design <- createDesign(N = c(10, 20),
SD = c(1, 2),
subset = !(N == 10 & SD == 2))
Design
# example with list inputs
Design <- createDesign(N = c(10, 20),
SD = c(1, 2),
combo = list(c(0,0), c(0,0,1)))
Design # notice levels printed (not typical for tibble)
print(Design, list2char = FALSE) # standard tibble output
Design <- createDesign(N = c(10, 20),
SD = c(1, 2),
combo = list(c(0,0), c(0,0,1)),
combo2 = list(c(5,10,5), c(6,7)))
Design
print(Design, list2char = FALSE) # standard tibble output
##########
## fractional factorial example
library(FrF2)
# help(FrF2)
# 7 factors in 32 runs
fr <- FrF2(32,7)
dim(fr)
fr[1:6,]
# Create working simulation design given -1/1 combinations
fDesign <- createDesign(sample_size=c(100,200),
mean_diff=c(.25, 1, 2),
variance.ratio=c(1,4, 8),
equal_size=c(TRUE, FALSE),
dists=c('norm', 'skew'),
same_dists=c(TRUE, FALSE),
symmetric=c(TRUE, FALSE),
# remove same-normal combo
subset = !(symmetric & dists == 'norm'),
fractional=fr)
fDesign
}
Run the code above in your browser using DataLab