Summary Table of Predictors
table_levelII_approximations.RdThis helper function prepares a table showing the five best and five worst-performing Level I algorithms in predicting a selected Level II-based diagnosis of probable PDD. It is primarily intended for use in the manuscript to keep Quarto document uncluttered.
Arguments
- values
A tibble of concordance statistics generated by
describe_concordance. Can also be provided by the data concords propagated with the package.- struct
A list generated by
list_algorithmswith two elements:[[1]]Character vector of Level I algorithm names derived using FAQ total > 7 as the IADL criterion.
[[2]]Character vector of Level I algorithm names derived using FAQ item 9 > 1 as the IADL criterion. Note: order matters.
- crit
A character string indicating which concordance statistics is to be used for comparisons. Can be one of
"Accuracy_raw","Balanced Accuracy","Kappa_raw","Sensitivity"or"Specificity".
Value
A list containing:
tableA tibble with the five best and five worst Level I algorithms in predicting the specified Level II-based diagnosis of probable PDD.
gtableA
gttable object summarising the concordance statistics (e.g., accuracy, kappa) of the five best and five worst Level I algorithms in predicting the specified Level II-based diagnosis of probable PDD.
See also
concords contains data for
values.describe_concordance()preparesvalues.list_algorithms()preparesstruct.gt_apa_table()formats the table.psych::cohen.kappa()computes and documents Cohen’s kappa and related metrics.caret::confusionMatrix()computes and documents the remaining metrics forcrit.
Examples
if (FALSE) { # \dontrun{
p <- data_paths("data-raw")
data <- prepare_data(p)
pdd <- diagnose_pdd_sample(data)
vars <- here::here("data-raw", "VariablesOfInterest.csv")
rates <- summarise_rates(pdd, vars)
algos <- list_algorithms(rates$table)
data(concords)
# Tables ordered by different statistics:
table_levelII_approximations(concords, algos, "Accuracy_raw") # Table 3
table_levelII_approximations(concords, algos, "Balanced Accuracy") # Table 7
table_levelII_approximations(concords, algos, "Kappa_raw")
table_levelII_approximations(concords, algos, "Sensitivity")
table_levelII_approximations(concords, algos, "Specificity")
} # }