Description Usage Arguments Details Value Methods (by generic) Examples
View source: R/aggregate_performance.R
Aggregate performance measures by cohort
1 2 3 4 5 |
perf.estimates |
A set of performance estimates of class |
reference |
The name of the reference score (default NULL, the first score is the reference). This will be the reference level of the scores in any later models. |
design.levels |
A character vector of alternate short names for the scores, to be used in naming the designs. Default is |
fn.mods |
A function used to summarize the moderators within cohorts. Moderators should be numeric as the mean is computed by default. Factor variables should converted to numeric prior to use in |
x |
An object of class |
... |
Other arguments to be passed to |
The aggregation of moderators here is different than what the function casemix
is doing. casemix
shows the actual levels of the moderators, either as median and IQR (or boxplots) for continuous variables, or tables (or barplots) for factor variables. In aggregate_performance
we assume a single number is needed to describe the overall value of the moderator, which is most commonly the mean. Factor variables with two levels (e.g. A and B) should be converted to 0/1 variables. Unordered factor variables with more than 2 levels (e.g. A, B, C, and D) should be collapsed to 0/1 variables (for example 0 = A, B, 1 = C, D). Ordered factor variables (e.g. I, II, III, IV) should be converted to numeric variables (e.g. 1, 2, 3, 4). Any factor variables will be dropped in aggregate_performance
.
A list with the following elements, of class mscagg
List of cohorts
Differences in score performance
Variance-covariance matrix for yi
Score contrasts
"Design" of the study (that is, which scores could be calculated)
Design matrix, corresponding to contr
A label for the analysis, which shows up in plots and output datasets
The function used to compute performance, for example calibration_slope
A vector of the scores used
The reference score
A vector of names of the moderators
A dataframe containing aggregated moderators
print
: Print basic aggregated performance measures
1 2 3 4 5 6 7 | dat <- msc_sample_data()
bssamp <- get_bs_samples(dat, id, study, outcome, n.samples = 5,
scores = c("a", "b", "c", "d", "e", "f"),
moderators = c("age", "female", "x1", "sex"))
perf <- compute_performance(bssamp, fn = calibration_slope, lbl = "CS")
agg <- aggregate_performance(perf)
head(agg)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.