Nothing
## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
## ----setup--------------------------------------------------------------------
library(LAGOtrials)
## -----------------------------------------------------------------------------
bb_data <- BB_data
head(bb_data[, c("coaching_updt", "launch_duration", "pp3_oxytocin_mother")])
## -----------------------------------------------------------------------------
result <- lago_optimization(
data = bb_data,
outcome_name = "pp3_oxytocin_mother",
outcome_type = "binary",
intervention_components = c("coaching_updt", "launch_duration"),
intervention_lower_bounds = c(1, 1),
intervention_upper_bounds = c(40, 5),
center_characteristics = "birth_volume_100",
center_characteristics_optimization_values = 1.75,
cost_list_of_vectors = list(c(0, 1700), c(0, 8000)),
outcome_goal = 0.85,
outcome_goal_intention = "maximize",
confidence_set_grid_step_size = c(1, 0.5),
quiet = TRUE
)
## -----------------------------------------------------------------------------
result
## -----------------------------------------------------------------------------
summary(result)
## -----------------------------------------------------------------------------
result$rec_int
result$rec_int_cost
## ----fig.width = 6, fig.height = 4--------------------------------------------
plot(result)
## -----------------------------------------------------------------------------
bb_data$group <- ifelse(bb_data$pre_post == 0, "control", "treatment")
power_result <- lago_optimization(
data = bb_data,
outcome_name = "pp3_oxytocin_mother",
outcome_type = "binary",
intervention_components = c("coaching_updt", "launch_duration"),
intervention_lower_bounds = c(1, 1),
intervention_upper_bounds = c(40, 5),
center_characteristics = "birth_volume_100",
center_characteristics_optimization_values = 1.75,
cost_list_of_vectors = list(c(0, 1700), c(0, 8000)),
power_goal = 0.8,
num_centers_in_next_stage = 10,
patients_per_center_in_next_stage = 30,
include_confidence_set = FALSE,
quiet = TRUE
)
power_result$est_outcome_goal
## -----------------------------------------------------------------------------
sens <- lago_sensitivity(
result,
parameter = "outcome_goal",
values = c(0.75, 0.80, 0.85, 0.90)
)
sens
## ----fig.width = 6, fig.height = 4--------------------------------------------
plot(sens)
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.