check_scenarios: Check accurate specification of 'scenarios' parameter to...

Description Usage Arguments Value Examples

Description

The 'scenarios' parameter must contain paired policies, i.e. if one scenario has early detection, a scenario must exist that has the same treatments but no early detection. This function checks for the correct pairing

Usage

1
check_scenarios(scenarios, treatinfo)

Arguments

scenarios

Data frame of scenarios to simulate (see example below). First scenario should be the base case.

treatinfo

Data frame with treatment hazard ratios, and for each scenario, treatment proportions, by stage-subgroups. See the example and the vignette

Value

NULL if scenarios are paired properly, or vector listing the problematic pairs

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
data(ex1)
# See scenarios
ex1$pol
# See treatment
ex1$tx
# Create version that have the "tam" scenario deleted and specify
# "base" and "tamandshift" scenarios as paired. This should fail.
fail <- ex1
fail$pol <- fail$pol[-2,]
fail$pol$num[2] <- 2
fail$pol$pairnum[2] <- 1
fail$tx$tam <- NULL

check_scenarios(ex1$pol, ex1$tx)
check_scenarios(fail$pol, fail$tx)

cancerpolicy/bcimodel documentation built on June 30, 2019, 12:39 a.m.