shift_stages: Use indicator of stage shift to change Advanced to Early...

Description Usage Arguments Examples

View source: R/earlydetect.R

Description

Use indicator of stage shift to change Advanced to Early stage

Usage

1
shift_stages(indicator, original, map)

Arguments

indicator

Matrix of 1s and 0s, 1=shift stage (see stageshift_indicator)

original

Matrix of numeric stage-subgroup id's. Rows=population size, columns=nsim.

map

Matrix with rows Early and Advanced, columns indicating subgroups, and cells with stage-subgroup id's (see create_stageshift_map)

Matrix

of new stage-subgroup id's after shift

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Stageshift map; stage-shifting will preserve subgroup status
(mapn <- matrix(1:4, ncol=2, dimnames=list(c('Early', 'Advanced'), c('ER+', 'ER-'))))
# Original stage-subgroup indicators
orig <- sim_multinom(10000, 2, c(0.25, 0.25, 0.25, 0.25), 1:4)
# Determine who gets stage-shifted
shifti <- stageshift_indicator(0.85, 10000, 2)
# Shift stages only for those with stageshift_indicator==1, preserving their
# subgroup
new <- shift_stages(shifti, orig, mapn)
table(new)/table(orig)

cancerpolicy/bcimodel documentation built on Feb. 13, 2018, 2:06 p.m.