Skip to contents

Compute the area between curves (ABC) for each scoring method in the "precmed" object. This should be run only after results of catecv() have been obtained.

Usage

# S3 method for class 'precmed'
abc(x, ...)

Arguments

x

An object of class "precmed".

...

Additional arguments (currently unused).

Value

Returns a matrix of numeric values with number of columns equal to the number cross-validation iteration and number of rows equal to the number of scoring methods in x.

Details

The ABC is the area between a validation curve and the overall ATE in the validation set. It is calculated for each scoring method separately. Higher ABC values are preferable as they indicate that more treatment effect heterogeneity is captured by the scoring method. Negative values of ABC are possible if segments of the validation curve cross the overall ATE line. The ABC is calculated with the auc() in utility.R with a natural cubic spline interpolation. The calculation of the ABC is always based on validation curves based on 100 proportions equally spaced from min(prop.cutoff) to max(prop.cutoff).

The ABC is a metric to help users select the best scoring method in terms of capturing treatment effect heterogeneity in the data. It should be used in complement to the visual inspection of the validation curves in the validation set in plot().

References

Zhao, L., Tian, L., Cai, T., Claggett, B., & Wei, L. J. (2013). Effectively selecting a target population for a future comparative study. Journal of the American Statistical Association, 108(502), 527-539.

See also

catecv() function and plot(), boxplot() methods for "precmed" objects.

Examples

# \donttest{
# Count outcome
cv_count <- catecv(response = "count",
                   data = countExample,
                   score.method = "poisson",
                   cate.model = y ~ age + female + previous_treatment +
                                previous_cost + previous_number_relapses +
                                offset(log(years)),
                   ps.model = trt ~ age + previous_treatment,
                   higher.y = FALSE, cv.n = 5, verbose = 1)
#> Warning: Variable trt was recoded to 0/1 with drug0->0 and drug1->1.
#> 
  |                                                                            
  |                                                                      |   0%
#> cv = 1 
#>   splitting the data..
#>   training..
#>   validating..
#> 
#> cv = 2 
#>   splitting the data..
#>   training..
#>   validating..
#> 
#> cv = 3 
#>   splitting the data..
#>   training..
#>   validating..
#> 
#> cv = 4 
#>   splitting the data..
#>   training..
#>   validating..
#> 
#> cv = 5 
#>   splitting the data..
#>   training..
#>   validating..
#> 
#> Total runtime : 14.48 secs 

# ABC of the validation curves for each method and each CV iteration
abc(cv_count)
#>               cv1        cv2         cv3       cv4        cv5
#> poisson 0.1226217 0.05313313 0.001182887 0.2257895 0.03782023

# Survival outcome
library(survival)
cv_surv <- catecv(response = "survival",
                  data = survivalExample,
                  score.method = c("poisson", "randomForest"),
                  cate.model = Surv(y, d) ~ age + female + previous_cost +
                               previous_number_relapses,
                  ps.model = trt ~ age + previous_treatment,
                  higher.y = FALSE,
                  cv.n = 5)
#> Warning: No value supplied for tau0. Default sets tau0 to the maximum survival time.
#> Warning: Variable trt was recoded to 0/1 with drug0->0 and drug1->1.

# ABC of the validation curves for each method and each CV iteration
abc(cv_surv)
#>                    cv1       cv2       cv3       cv4       cv5
#> poisson      0.1923841 0.1952059 0.1755373 0.1835761 0.1960739
#> randomForest 0.1826734 0.1950689 0.1718407 0.1770140 0.1924507

# }