casemix: Summary of case-mix for key moderators

Description Usage Arguments Examples

View source: R/casemix.r

Description

Examines case-mix according to key moderators, by study.

Usage

1
casemix(bss, mods = NULL, max.levels = 20, plot = TRUE)

Arguments

bss

output from get_bs_samples

mods

Which variables should be examined, of the mods in bss? (default NULL, means all)

max.levels

If a numeric variable has fewer than max.levels distinct values, than it will be displayed as a categorical / factor variable. If a categorical variable

plot

if TRUE (the default) then summary plots are produced. If not, tables of summary statistics are returned.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
dat <- msc_sample_data()
dat$agegrp <- cut(dat$age, c(0, 20, 40, 60, 80, 100))
dat$agegrp2 <- cut(dat$age, seq(0, 100, 5))
dat$agegrp3 <- as.numeric(dat$agegrp2)
bssamp <- get_bs_samples(dat, id, study, outcome, n.samples = 10, 
                  scores = c("a", "b", "c", "d", "e", "f"), 
                  moderators = c("age", "agegrp", "agegrp2", "agegrp3", "female", "sex", "x1"))
casemix(bssamp)
casemix(bssamp, plot = FALSE)
casemix(bssamp, mods = c("agegrp2", "agegrp3"), max.levels = 10)   

srhaile/mscpredmodel documentation built on Sept. 13, 2019, 3:44 p.m.