data-raw/opportunity_cost/opportunity_cost-dataprep.R

# Load packages
library(tidyverse)
library(usethis)

# Add opportunity cost data
opportunity_cost <- tibble(
  group = c(rep("control", 75), rep("treatment", 75)),
  decision = c(
    rep("buy video", 56), rep("not buy video", 19),
    rep("buy video", 41), rep("not buy video", 34)
  )
) |>
  mutate(
    group = as.factor(group),
    decision = as.factor(decision)
  )

# Add to package
use_data(opportunity_cost, overwrite = TRUE)
OpenIntroStat/openintro documentation built on June 4, 2024, 4:19 a.m.