Description Usage Arguments Details Value Methods (by generic) Examples
View source: R/compute_performance.R
Computes performance measures for prognostic scores on a set of bootstrap samples
1 2 3 4 5 6 7 8 9 10 11 12 13 |
bs.sample |
A set of cohort-stratified bootstrap samples, as generated with |
fn |
The name of a function to compute performance measures. For example, |
lbl |
A label to describe the performance measure computed. For example |
x |
Set of performance estimates calculated with |
... |
Other arguments to be passed to |
object |
Set of performance estimates calculated with |
nonpar |
Should nonparametric summary statistics (median [IQR]) be reported? (TRUE) |
NArm |
Should NAs be removed before calculated summary statistics? (TRUE) |
The function to compute performance measures, fn
requires two arguments:
The name of the bootstrap sample. The full bootstrap data is called within the function as analysis(bss)
. See bootstraps
for more details.
The formula that will be called by the model, of the form outcome ~ score
(character).
and outputs a single numeric value. A value of NA
is assigned if there is an error.
A list with 3 elements, of class msc_raw
:
A tibble containing a set of "working estimates", the raw performance measures, before they have been aggregated or contrasts have been computed.
Names of the scores as given in get_bs_samples
vector of formulas)
The function definition used to compute performance
The label given in the arguments.
The results of compute_performance
have suitable print
and summary
methods.
print
: Print raw performance estimates
summary
: Summary of raw performance estimates
points
: Plot variability of raw performance estimates across bootstrap samples using points
lines
: Plot variability of raw performance estimates across bootstrap samples using lines (density plots)
1 2 3 4 5 6 7 8 9 | dat <- msc_sample_data()
bssamp <- get_bs_samples(dat, id, study, outcome, n.samples = 5,
scores = c("a", "b", "c"),
moderators = "age")
perf <- compute_performance(bssamp, fn = calibration_slope, lbl = "CS")
print(perf)
summary(perf)
points(perf)
lines(perf)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.