diagnosticSummary 0.0.2.20
Changes that affect results
- The estimate of a proportion is the observed proportion for every
citype. Withcitype = "bayes"it was the posterior mean, which disagreed with the fraction shown beside it. Intervals are unchanged.
Bug fixes
-
prevalence,threshold_range, andgrouping_variablesacceptNULLor a missing value of any type, such asNA_real_, as not supplied, which gave an error in 0.0.2.19. Proportions with a denominator of 0 gave an error withcitype = "profile"or"prop.test", sodx_itd()failed when no prediction was missing, and were reported as 50% with"bayes".dx_plot_forest()gives a clear error when no odds ratio can be calculated, anddx_plot_decision_curve()withposlabel = 0could miss the first point ofplot_range. Errors that name a function no longer print its code when it is called withdo.call().
Dependencies
- The plot functions give an error when ggplot2 is older than 3.4.0
diagnosticSummary 0.0.2.19
Breaking changes
-
dx()anddx_itd()now give an error for invalid options, which previously failed later with an unclear error or were silently ignored.citypemust be a method ofbinom::binom.confint(),threshold_rangemust hold numbers between 0 and 1,prevalencemust be a single number greater than 0 and less than 1,dobootmust beTRUEorFALSE,bootrepsmust be a whole number of at least 1, andgrouping_variablesmust be unique column names indataother than “Overall”. -
dx_cm(),dx_auc(), anddx_brier()now give an error whentruthandpredprobdiffer in length, have missing values, ortruthisn’t 0/1.dx_cm()anddx_brier()also require predictions between 0 and 1.dx_fbeta()requiresbetato be a single positive number, anddx_delong(),dx_z_test(), anddx_mcnemars()requiredetailto be “simple” or “full”. -
breslow_day_test()requires a 2x2xK array of counts with at least two strata, and gives an error when a stratum has an empty row or column - The
dx_plot_*functions give an error when they aren’t given adxobject (adx_compareobject fordx_plot_rocs()), or whenplot_range,plot_type,summary_stats,bins,levels, or log-scalelimitsare invalid
Changes that affect results
- The odds ratio and likelihood ratios are
NAwhen every prediction is on one side of the threshold. Previously the continuity correction gave values that only reflected the number of cases in each class. A single empty cell is still corrected by adding 0.5 to each cell. -
dx_plot_decision_curve()calculates net benefit on an even grid of thresholds acrossplot_rangeand at each distinct prediction, instead of only at the predictions. The curve is now also drawn for models with few distinct predictions, such as 0/1 classes. - The G-test is
NAwhen every prediction is on one side of the threshold, matching the chi-squared test, and empty cells contribute exactly 0 - The kappa confidence interval uses the exact normal quantile instead of 1.96, and an undefined kappa is noted as undefined instead of “Slight Agreement”
- Proportions with a denominator of 0 have no confidence interval for any
citype. Previously"exact"gave 0% to 100%. -
dx_z_test()returns an estimate of 0 and a p-value ofNA, with a note, when both proportions are 0 or both are 1 - Numbers that round to zero are no longer shown with a minus sign
Bug fixes
-
dx_plot_forest()gave an error withtrans = NA, its documented default, when passed explicitly, and replaced a subgroup’s odds ratio with the Breslow-Day p-value when the subgroup had the same name as its variable.breslow_day_test()keeps precision for very small p-values and no longer names its results after a level of the table. The message for a missing suggested package no longer repeats “must be”.
New features
-
print()methods fordx,dx_itd, anddx_compareobjects show the inputs and a few headline measures (or the table of tests) instead of the whole list
Dependencies
- The plots need ggplot2 >= 3.4.0
diagnosticSummary 0.0.2.18
Dependencies
- Requires R >= 3.5.0
Bug fixes
-
summary()fordxanddx_itdobjects returns a data frame when knitr isn’t installed, instead of printing the table and returning it invisibly. The documentation fordx_heart_failurenow cites its source, the Hungarian records in the UCI Heart Disease data set, in place of a dead link.
diagnosticSummary 0.0.2.17
Breaking changes
-
dx()now gives an error unlesssetthresholdis a single number between 0 and 1. Previously other values failed later with an unclear error or gave results with every case on one side of the threshold.
New features
-
dx_itd()summarizes a diagnostic test when some predictions are missing, for example because a case failed quality control. Missing predictions are kept as ungradable results in a 3x2 intention-to-diagnose analysis instead of being excluded. It reports the diagnostic yield, pre-test disease risk, predictive values, post-test disease risk and likelihood ratio for each result, and worst-case sensitivity, specificity, and Youden’s J, which count ungradable results as incorrect.dx_itd_table()lays the results out as a 3x2 table, andsummary()andas.data.frame()methods are included. -
dx()still gives an error for missing predictions, and the message now points todx_itd()
diagnosticSummary 0.0.2.16
Breaking changes
-
dx_auc_pr()now takestruthandpredprob(plusdetailandposlabel) instead ofprecisionandrecall, and checks its inputs, so calls with the old arguments give an error - The chi-squared measure is renamed from “Pearson’s Chi-squared” to “Pearson’s Chi-squared (Yates’ correction)”. Code that filters results on the old name needs updating.
-
dx()no longer addstest_binary,test_binaryf, andtrue_binaryfcolumns todata. Previously it overwrote user columns with these names, so a truth column namedtest_binarygave a perfect model.
Deprecated
-
classlabelsandoutcome_labelindx()have no effect and now give a warning. They are no longer stored inoptions. -
directionvalues other than"<"are deprecated. Predictions are probabilities that the outcome is 1; useposlabelto choose the event.
Changes that affect results
-
poslabel = 0is now used by the rank table and the ROC, gain, lift, KS, CAP, and decision curves, which previously always treated 1 as the event and gave a warning. Net benefit forposlabel = 0now weights by the event’s threshold probability, 1 minus the threshold. - AUC-PR and the PR curve use Davis & Goadrich (2006) interpolation instead of straight lines between points. Values change slightly.
- The kappa confidence interval uses the Fleiss, Cohen & Everitt (1969) variance
- Bootstrapped confidence intervals resample confusion matrix cell counts, which is equivalent to resampling cases and much faster. Intervals differ by Monte Carlo error at the same
bootseed, can differ across platforms and R versions, and the defaultbootrepsin the metric functions is now 2000, matchingdx(). - With tied predictions, gain, lift, and CAP curves only pass through points a threshold can reach, and gain and CAP curves start at the origin.
rankhas a newreachablecolumn. - Agresti-Coull confidence intervals are truncated to 0 to 1
- Estimates without a confidence interval are shown with a fixed number of decimals (3 for the Brier score and AUC-PR), and the no information rate is shown as a percent
Bug fixes
- Measures in
dx()could disagree withcmwhensetthresholdequaled a prediction, andthresholdshad duplicate rows when predictions included exactly 0 or 1. The Breslow-Day test and paireddx_delong()now returnNAwith a note instead of an error when they are undefined (every subgroup separates perfectly, or a class has one observation).
New features
-
dx_recall(),dx_tpr(),dx_tnr(),dx_precision(),dx_miss_rate(),dx_fall_out(), anddx_youden_j()are now exported, as documented -
thresholdshas a newevent_thresholdcolumn, the threshold as a probability of the event -
dx_delong()notes say whether a Z or t statistic was used -
dx()is much faster for large data sets, especially withdoboot = TRUE. caret and broom are no longer suggested packages.
diagnosticSummary 0.0.2.15
Breaking changes
-
dx()now stops with an error if the prediction or truth variable has missing values, or if predictions are outside 0 to 1. Previously these gave unclear errors or, for predictions outside 0 to 1, results such as a meaningless Brier score. -
directionindx()anddx_auc()now defaults to"<"(higher predictions indicate the positive class) instead of"auto". Models that perform worse than chance now report an AUC below 0.5 instead of a flipped AUC. The AUC indx()measures now also respectsdirection. - Bootstrapped confidence intervals now use
bootseed, which was previously ignored, so their values will change. Results are now reproducible regardless of the session’s random seed. -
poslabelmust be 0 or 1, anddx_compare()requires each model to have a unique name. Previously other values ran silently with wrong results. -
directiononly affects the AUC and ROC curve, sodx()now warns when it isn’t"<", and plots that always treat 1 as the positive class (gain, lift, KS, CAP, and decision curves) warn whenposlabel = 0.
Bug fixes that change results
- The net benefit in
dx_plot_decision_curve()(and thenet_benefitcolumn ofthresholds) used the wrong formula, which overstated the model’s benefit relative to treating all or none. It now uses the standard formula from Vickers & Elkin (2006). - The KS statistic in
dx_plot_ks()was inflated when predictions were tied - Cohen’s kappa was
NAfor data sets with more than about 46,000 rows due to integer overflow, and its confidence interval could extend beyond -1 to 1 - Subgroups with only one outcome class or very few rows no longer cause
dx()to fail. Measures that are undefined for these subgroups (AUC, odds ratio, likelihood ratios, chi-square, Fisher’s exact, and G-tests) areNA, with a warning, and the Breslow-Day test only uses subgroups with both outcome classes and both predicted classes. -
dx_plot_forest()placed axis ticks on a different scale from the odds ratios when breaks did not span the axis limits, and gave incorrect labels fortrans = "log10"withbreaks. Breaks are now always given as odds ratios. -
dx_plot_roc()shaded less than the AUC when predictions were tied, and its curve did not match the AUC whendirectionwas not"<". The curve now comes from the same ROC object as the AUC. - Thresholds created with
seq()were duplicated in the results and could not be selected withas.data.frame()orsummary()
Other bug fixes
- Subgroups are ordered by factor level, unused factor levels are dropped, and
as.data.frame()andsummary()can filter on several values. Bootstrapped measures are displayed as decimals instead of percentages.dx_plot_roc()anddx_plot_forest()no longer give ggplot2 warnings, forest plots style subgroups with a missing odds ratio correctly, anddx()anddx_plot_forest()no longer change the session’s random seed.dx_compare()no longer mislabels models when only some are named, andsummary()gives a clear error when given several thresholds. -
dx()no longer fails with column names that contain spaces or with large subgroups (integer overflow in the Breslow-Day test), and unpaireddx_compare()no longer fails when a model has no predicted positives or negatives.dx_plot_pr()keeps its end point,dx_plot_forest()gives a clear error without grouping variables, and kappa of 1 is interpreted as almost perfect agreement.
diagnosticSummary 0.0.2.14
Bug fixes
-
dx_compare()now compares all pairs of models instead of only the first pair, and labels each row with its own pair -
dx_z_test()anddx_delong()now report the signed difference (dx1minusdx2) so the estimate matches its confidence interval. Previously the absolute difference was reported, so estimates may now be negative. -
dx_compare()results now keepestimate,p_value, andstatisticas numeric columns - Unpaired
dx_delong()summaries no longer show an empty confidence interval
diagnosticSummary 0.0.2.13
Bug fixes
- Subgroup analyses no longer include rows where the grouping variable is missing
diagnosticSummary 0.0.2.12
New metrics
- Added
dx_npv_prevalenceanddx_ppv_prevalenceto calculate NPV and PPV at a specified prevalence - New
prevalenceargument indxadds prevalence-adjusted NPV and PPV to the output
Bug fixes
-
dx_plot_forestkeeps measures in the requested order
diagnosticSummary 0.0.2.11
Bug fixes
- Fixed a row bind warning in
dx_plot_forestwith newer versions of R
diagnosticSummary 0.0.2.10
Changes
- Variables in
grouping_variablesare converted to factors instead of throwing an error
Bug fixes
- PPV in
thresholdsoutput was calculated using NPV
diagnosticSummary 0.0.2.00
New metrics
- Prevalence
- False Negative Rate
- False Positive Rate
- False Discovery Rate
- PR AUC
- Cohen’s Kappa
- Matthews Correlation Coefficient
- Balanced Accuracy
- F-beta
- F2
- Informedness
- Markedness
- G-mean
- Fowlkes-Mallows Index
- Brier Score
- Detection Prevalence
- No Information Rate (NIR)
Also added aliases for metrics with the same name (e.g., recall and true positive rate for sensitivity)
New/modified tests
- Breslow and Day test implemented within package
- Added Chi-Square Test
- Added Fisher’s Exact Test
- Added G-Test (Log-Likelihood Ratio Test)
- Added McNemar’s Chi-squared Test for Paired Proportions
- Added Z-test for Comparing Two Proportions
- Added DeLong’s Test for Comparing Two ROC Curves
New output
- Added
thresholdsto the output ofdxcontaining metrics across a full range of thresholds - Added
prevalenceto the output ofdxcontaining metrics across a full range of prevalencies - Added
rankto the output ofdxcontaining rank-based summaries from predicted probabilities
Changes to dx_obj$measures output
-
rawestimecolumn renamed toestimate -
rawuciandrawlcicolumn renamed toconf_lowandconf_high
New plots
- Added lift curve:
dx_plot_lift - Added Kolmogorov-Smirnov plot:
dx_plot_ks - Added cumulative gains chart:
dx_plot_gain - Added Precision-Recall plot:
dx_plot_pr - Added NPV and PPV across prevalencies:
dx_plot_predictive_value - Added calibration curve:
dx_plot_calibration - Added decision curve:
dx_plot_decision_curve - Added Youden’s J Index Curve:
dx_plot_youden_j - Added Cumulative Accuracy Profile (CAP) curve:
dx_plot_cap - Added cost curve:
dx_plot_cost - Added plot showing metrics across thresholds:
dx_plot_thresholds - Add ability to plot multiple ROC curves:
dx_plot_rocs
Renamed Functions
- The confusion matrix plot was renamed from
dx_cmtodx_plot_cm(dx_cmnow constructs the confusion matrix) -
dx_rocwas renameddx_plot_roc -
dx_forestwas renameddx_plot_forest
Bug Fixes
- Breslow-Day test no longer silently left out if DescTools not installed
-
levelsargument inas.data.frameandsummarydidn’t filter tolabelcolumn - Matthews Correlation Coefficient no longer overflows with large confusion matrix counts
- Chi-square test was included twice in
dxmeasures
Dependencies
- Removed
dplyr,scales,boot, andtidyrfrom Imports - Moved
gtable,grid, andgridExtrato Suggests - Removed
DescToolsande1071from Suggests - Added
tibbleto Suggests
Comparison of dx objects
- New
dx_comparefunction to run pairwise tests on a list ofdx_objects
Documentation
- Added a
NEWS.mdfile to track changes to the package. - Added documentation/descriptions/details to all functions
- Migrated pkgdown website to bootstrap 5
