add_features: Add features like stage and tumor type to an initialized...

Description Usage Arguments Value Examples

Description

Add features like stage and tumor type to an initialized population

Usage

1
add_features(popbysim, probs, names = NULL)

Arguments

popbysim

A matrix of dimensions (population size)x(number of sims)

probs

A vector of probabilities summing to 1. Each probability represents the probability of being in each feature group stage and tumor-type subgroup

stagetumor

Optional vector of names corresponding to the stage-tumor subgroups in probs. Defaults to 1:length(probs)

Value

Matrix of dimensions (pop size)x(nsim) indicating stage-tumor status according to the 'names' parameter Defaults to 1:length(probs)

Examples

1
2
3
4
5
6
Say there are four stage-ER receptor subgroups that have equal probability,
in a population of size 20 and 2 simulations
add_features(matrix(1, nrow=20, ncol=2), probs=c(0.25, 0.25, 0.25, 0.25))
Could ID the groups by name
add_features(matrix(1, nrow=20, ncol=2), probs=c(0.25, 0.25, 0.25, 0.25),
             names=c('EarlyER+', 'EarlyER-', 'AdvancedER+', 'AdvancedER-'))

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