hROC {movieROC} | R Documentation |
Build a ROC curve for a transformation of a univariate marker
Description
This is one of the main functions of the movieROC package.
It builds a univariate ROC curve for a transformed marker h(X)
and returns a ‘hroc’ object, a list of class ‘hroc’.
This object can be print
ed, plot
ted, or predict
ed
for a particular point. It may be also passed to
plot_funregions()
and plot_regions()
functions.
Usage
hROC(X, D, ...)
## Default S3 method:
hROC(X, D, type = c("lrm", "overfitting", "kernel", "h.fun"),
formula.lrm = "D ~ pol(X,3)", h.fun = function(x) {x}, kernel.h = 1,
plot.h = FALSE, plot.roc = FALSE, new.window = FALSE,
main = NULL, xlab = "x", ylab = "h(x)", xaxis = TRUE, ...)
Arguments
X |
Vector of marker values. |
D |
Vector of response values. Two levels; if more, the two first ones are used. |
type |
Type of transformation considered. One of
|
formula.lrm |
If |
kernel.h |
If |
h.fun |
If |
plot.h |
If TRUE, the transformation employed is illustrated. |
plot.roc |
If TRUE, the resulting ROC curve is illustrated. |
new.window |
If TRUE, two previous graphics are plotted separately in different windows. |
main |
A main title for the plot used if |
xlab , ylab |
A label for the x and y axis of the plot used if |
xaxis |
Graphical parameter used if |
... |
Other parameters to be passed. Not used. |
Details
A theoretical and practical discussion about the type
of transformation considered and its basis may be found in Martínez-Camblor et al. (2019) and Martínez-Camblor et al. (2021).
The overfitting function estimate is defined as follows:
\hat{h}_{of}(x) = \sum_{i=1}^{n_1} I(x = y_i) + \sum_{i=1}^{n_2} \dfrac{\#(\xi = z_i)}{\#(\xi = z_i) + \#(\chi = z_i)} I(x = z_i)
where I(A)
denotes the indicator function (which takes the value 1 if A
is true and 0 otherwise), \#(B)
is the cardinal of the subset B
, \{y_1, \dots, y_{n_1}\} \subseteq \left\{ \xi_1, \dots, \xi_n \right\}
are the positive sample values without ties and \{z_1, \dots, z_{n_2}\} \subseteq \left\{ \xi_1, \dots, \xi_n \right\}
are the positive sample values with ties with any negative sample value. Classification based on this transformation is the optimal one in the AUC sense, but the resulting decision rules cannot be extended to any other sample.
Value
A list of class ‘hroc’ with the following fields:
levels |
Levels of response values. |
X , Y |
Original and transformed marker values, respectively. |
Sp , Se |
Vector of true-negtive and true-positive rates, respectively. |
auc |
Area under the curve estimate. |
model |
If |
Dependencies
If type = "lrm"
, the lrm()
function in the rms package is used. This library is also loaded to consider special transformation functions such as pol()
and rcs()
.
References
P. Martínez-Camblor, S. Pérez-Fernández, and S. Díaz-Coto (2019) “Improving the biomarker diagnostic capacity via functional transformations”. Journal of Applied Statistics, 46(9): 1550–1566. DOI: doi:10.1080/02664763.2018.1554628.
P. Martínez-Camblor, S. Pérez-Fernández, and S. Díaz-Coto (2021) “Optimal classification scores based on multivariate marker transformations”. AStA Advances in Statistical Analysis, 105(4): 581–599. DOI: doi:10.1007/s10182-020-00388-z.
Examples
data(HCC)
# ROC curve for gene 18384097 to identify tumor by considering 4 different transformations:
X <- HCC$cg18384097; D <- HCC$tumor
## 1. Ordinary cubic polynomial formula for binary logistic regression
hROC(X, D)
## 2. Linear tail-restricted cubic splines for binary logistic regression
hROC(X, D, formula.lrm = "D ~ rcs(X,8)")
## 3. Overfitting transformation for this particular sample
hROC(X, D, type = "overfitting")
## 4. Optimal transformation in terms of likelihood ratio
## by kernel density estimation with bandwidth 3
hROC(X, D, type = "kernel", kernel.h = 3)