Create (partial) factorial design

doe(factors, int = "", trials = NA, seed = NA)

Arguments

factors

Categorical variables used as input for design

int

Vector of interaction terms to consider when generating design

trials

Number of trials to create. If NA then all feasible designs will be considered until a design with perfect D-efficiency is found

seed

Random seed to use as the starting point

Value

A list with all variables defined in the function as an object of class doe

Details

See https://radiant-rstats.github.io/docs/design/doe.html for an example in Radiant

See also

summary.doe to summarize results

Examples

doe(c("price; $10; $13; $16", "food; popcorn; gourmet; no food"))
#> $df #> $df$price #> [1] "$10" "$13" "$16" #> #> $df$food #> [1] "popcorn" "gourmet" "no_food" #> #> #> $cor_mat #> price food #> price 1.000000e+00 -1.665335e-16 #> food -1.665335e-16 1.000000e+00 #> #> $detcm #> [1] 1 #> #> $Dea #> [1] 1 #> #> $part #> trial price food #> 1 1 $10 popcorn #> 2 2 $10 gourmet #> 3 3 $10 no_food #> 4 4 $13 popcorn #> 5 5 $13 gourmet #> 6 6 $13 no_food #> 7 7 $16 popcorn #> 8 8 $16 gourmet #> 9 9 $16 no_food #> #> $full #> trial price food #> 1 1 $10 popcorn #> 2 2 $10 gourmet #> 3 3 $10 no_food #> 4 4 $13 popcorn #> 5 5 $13 gourmet #> 6 6 $13 no_food #> 7 7 $16 popcorn #> 8 8 $16 gourmet #> 9 9 $16 no_food #> #> $eff #> Trials D-efficiency Balanced #> 1 5 0.018 FALSE #> 2 6 0.449 TRUE #> 3 7 0.383 FALSE #> 4 8 0.368 FALSE #> 5 9 1.000 TRUE #> #> $seed #> [1] NA #> #> attr(,"class") #> [1] "doe" "list"
doe( c("price; $10; $13; $16", "food; popcorn; gourmet; no food"), int = "price:food", trials = 9, seed = 1234 )
#> $df #> $df$price #> [1] "$10" "$13" "$16" #> #> $df$food #> [1] "popcorn" "gourmet" "no_food" #> #> #> $cor_mat #> price food #> price 1.000000e+00 -1.665335e-16 #> food -1.665335e-16 1.000000e+00 #> #> $detcm #> [1] 1 #> #> $Dea #> [1] 1 #> #> $part #> trial price food #> 1 1 $10 popcorn #> 2 2 $10 gourmet #> 3 3 $10 no_food #> 4 4 $13 popcorn #> 5 5 $13 gourmet #> 6 6 $13 no_food #> 7 7 $16 popcorn #> 8 8 $16 gourmet #> 9 9 $16 no_food #> #> $full #> trial price food #> 1 1 $10 popcorn #> 2 2 $10 gourmet #> 3 3 $10 no_food #> 4 4 $13 popcorn #> 5 5 $13 gourmet #> 6 6 $13 no_food #> 7 7 $16 popcorn #> 8 8 $16 gourmet #> 9 9 $16 no_food #> #> $eff #> Trials D-efficiency Balanced #> 1 9 1 TRUE #> #> $seed #> [1] 1234 #> #> attr(,"class") #> [1] "doe" "list"