The goal of npowerassignment is to manage random assignment for the NPower RCT.
It manages the initialization of the experiment, assigning cohorts of participants, and logging their assignments.
You can install the development version from GitHub with:
# install.packages("devtools")
devtools::install_github("context-dependent/npowerassignment")
To initialize the experiment:
library(npowerassignment)
## basic example code
initialize_experiment(
custom_parameters = list(
minimum_list_size = 1000,
overall_treatment_probability = 0.5,
minimum_treatment_probability = 0.2,
maximum_treatment_probability = 0.8,
eligible_locations = "Greater Toronto Area - GTA, ON",
eligible_programs = "Junior IT Analyst Program (JITA)",
rep_target_gender_diversity = 0.5
)
)
Assign a cohort of applicants:
applicants <- sample_cohort
assign_cohort(applicants)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.