Created
May 14, 2019 14:01
-
-
Save debruine/9051c6fa4f7ec8b8568c72d5bd851d00 to your computer and use it in GitHub Desktop.
Example design spec for scienceverse
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(faux) | |
within <- list( | |
pet = c("dog" = "Has a dog", "cat" = "Has a cat"), | |
time = c("day" = "Tested during the day", "night" = "Tested at night") | |
) | |
wcells <- faux:::cell_combos(within) | |
between <- list( | |
country = c("UK" = "United Kingdom", "NL" = "Nederland"), | |
condition = c("A" = "Condition A", "B" = "Condition B") | |
) | |
bcells <- faux:::cell_combos(between) | |
n <- 50 # per cell | |
mu <- matrix(c(1:4, 4:1, 1:4, 4:1), | |
nrow = length(wcells), | |
ncol = length(bcells), | |
dimnames = list(wcells, bcells)) | |
sd <- 1 | |
r <- list( | |
UK_A = 0.5, | |
UK_B = 0.25, | |
NL_A = 0.75, | |
NL_B = 0.5 | |
) | |
design <- check_design(within, between, n, mu, sd, r) | |
jsonlite::toJSON(design, auto_unbox = TRUE, pretty = TRUE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment