Description Usage Arguments Examples
Use indicator of stage shift to change Advanced to Early stage
1 | shift_stages(indicator, original, map)
|
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 |
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.