## ----include=FALSE------------------------------------------------------------
knitr::opts_chunk$set(collapse = TRUE, comment = "#>")
library(ggpower)

## -----------------------------------------------------------------------------
d <- effect_size_d(mean_h1 = 15, mean_h0 = 10, sd = 8)
d

## -----------------------------------------------------------------------------
power_compute("t_one_sample", "a_priori", d = d, alpha = 0.05,
              power = 0.95, tails = "one")

## -----------------------------------------------------------------------------
ggpower_tests()[, c("id", "family", "domain", "module")]

## ----modules, echo=FALSE------------------------------------------------------
data.frame(
  Question = c(
    "What sample size for a standard t test or ANOVA?",
    "Can my biomarker discriminate cases from controls (AUC)?",
    "Is my classifier sensitive and specific enough?",
    "Does a biomarker predict survival?",
    "How many patients for a Phase III superiority trial?",
    "Is treatment non-inferior to standard of care?",
    "Is a new formulation equivalent (bioequivalence)?",
    "Oncology single-arm Phase II with early stopping?"
  ),
  Module = c(
    "Power Workspace",
    "Biomarker Discovery",
    "Biomarker Discovery",
    "Biomarker Discovery",
    "Clinical Trials",
    "Clinical Trials",
    "Clinical Trials",
    "Clinical Trials"
  ),
  Example_test = c(
    "t_two_sample",
    "roc_auc_one",
    "diagnostic_acc",
    "cox_regression",
    "rct_superiority_continuous",
    "rct_noninferiority_binary",
    "rct_equivalence_continuous",
    "simon_two_stage"
  )
)

## ----filter-------------------------------------------------------------------
ggpower_tests(module = "biomarker")[, c("id", "label")]

## ----filter2------------------------------------------------------------------
ggpower_tests(module = "clinical")[, c("id", "label")]

