Skip to content

Commit ef92394

Browse files
author
Robin Enrico Denz
committed
fix: CRAN issues, remove tmle based methods, update citation info
1 parent 1845c96 commit ef92394

29 files changed

+71
-2194
lines changed

DESCRIPTION

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
Package: adjustedCurves
22
Title: Confounder-Adjusted Survival Curves and Cumulative Incidence
33
Functions
4-
Version: 0.9.1
4+
Version: 0.10.0
55
Authors@R:
66
person("Robin", "Denz", , "robin.denz@rub.de", role = c("aut", "cre"))
77
Maintainer: Robin Denz <robin.denz@rub.de>
88
Description: Estimate and plot confounder-adjusted survival curves using
99
either 'Direct Adjustment', 'Direct Adjustment with Pseudo-Values',
1010
various forms of 'Inverse Probability of Treatment Weighting', two
11-
forms of 'Augmented Inverse Probability of Treatment Weighting',
12-
'Empirical Likelihood Estimation' and 'Targeted Maximum Likelihood
13-
Estimation'. Also includes a significance test for the difference
11+
forms of 'Augmented Inverse Probability of Treatment Weighting' and
12+
'Empirical Likelihood Estimation'.
13+
Also includes a significance test for the difference
1414
between two adjusted survival curves and the calculation of adjusted
1515
restricted mean survival times. Additionally enables the user to
1616
estimate and plot cause-specific confounder-adjusted cumulative
1717
incidence functions in the competing risks setting using the same
1818
methods (with some exceptions).
19-
For details, see Denz et. al (2022) <arXiv:2203.10002v1>.
19+
For details, see Denz et. al (2023) <doi:10.1002/sim.9681>.
2020
License: GPL (>= 3)
2121
URL: https://github.com/RobinDenz1/adjustedCurves,
2222
https://robindenz1.github.io/adjustedCurves/
@@ -31,8 +31,6 @@ Imports:
3131
Suggests:
3232
MASS,
3333
Matching (>= 4.9),
34-
R6,
35-
SuperLearner (>= 2.0.0),
3634
WeightIt (>= 0.11.0),
3735
cmprsk (>= 2.2),
3836
eventglm (>= 1.1.1),
@@ -47,7 +45,6 @@ Suggests:
4745
riskRegression (>= 2020.12.08),
4846
rmarkdown,
4947
survival (>= 3.0.0),
50-
survtmle (>= 1.1),
5148
testthat (>= 3.0.0),
5249
tidyr,
5350
ggpp (>= 0.4.3),
@@ -59,4 +56,4 @@ Config/testthat/edition: 3
5956
Contact: <robin.denz@rub.de>
6057
Encoding: UTF-8
6158
Roxygen: list(markdown = TRUE)
62-
RoxygenNote: 7.2.1
59+
RoxygenNote: 7.2.3

NAMESPACE

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ export(cif_direct_pseudo)
3131
export(cif_iptw)
3232
export(cif_iptw_pseudo)
3333
export(cif_matching)
34-
export(cif_tmle)
3534
export(plot_curve_diff)
3635
export(plot_rmst_curve)
3736
export(plot_rmtl_curve)
@@ -47,11 +46,9 @@ export(surv_iptw_km)
4746
export(surv_iptw_pseudo)
4847
export(surv_km)
4948
export(surv_matching)
50-
export(surv_ostmle)
5149
export(surv_strat_amato)
5250
export(surv_strat_cupples)
5351
export(surv_strat_nieto)
54-
export(surv_tmle)
5552
importFrom(doRNG,"%dorng%")
5653
importFrom(dplyr,"%>%")
5754
importFrom(foreach,"%dopar%")

NEWS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,9 @@
88
* Updated code and tests to run with updated versions of the mice and ggplot2 packages
99
* Updated documentation of package man page to include features not supported at the moment
1010

11+
# adjustedCurves 0.10.0
12+
13+
* Removed support for tmle, ostmle methods
14+
* Changed citation information because manuscript was published
15+
* Changed `print` method to be equal to `summary` method
16+
* Fixed issues with unit-tests that require packages under "Suggests" only

R/adjustedcif.r

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -404,12 +404,6 @@ adjustedcif_boot <- function(data, variable, ev_time, event, cause, method,
404404

405405
}
406406

407-
## S3 print method for adjustedcif objects
408-
#' @export
409-
print.adjustedcif <- function(x, ...) {
410-
print(x$adjcif, ...)
411-
}
412-
413407
## S3 summary method for adjustedcif objects
414408
#' @export
415409
summary.adjustedcif <- function(object, ...) {
@@ -429,8 +423,6 @@ summary.adjustedcif <- function(object, ...) {
429423
} else if (object$method=="aiptw_pseudo") {
430424
method_name <- paste0("Augmented Inverse Probability of Treatment",
431425
" Weighting: Pseudo-Values")
432-
} else if (object$method=="tmle") {
433-
method_name <- "Targeted Maximum Likelihood Estimation"
434426
} else if (object$method=="aalen_johansen") {
435427
method_name <- "Aalen-Johansen Estimator"
436428
}
@@ -473,6 +465,12 @@ summary.adjustedcif <- function(object, ...) {
473465
}
474466
}
475467

468+
## S3 print method for adjustedcif objects
469+
#' @export
470+
print.adjustedcif <- function(x, ...) {
471+
summary(x, ...)
472+
}
473+
476474
## S3 print method for adjustedcif.method objects
477475
#' @export
478476
print.adjustedcif.method <- function(x, ...) {

R/adjustedsurv.r

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -424,12 +424,6 @@ adjustedsurv_boot <- function(data, variable, ev_time, event, method,
424424
return(adjsurv_boot)
425425
}
426426

427-
## S3 print method for adjustedsurv objects
428-
#' @export
429-
print.adjustedsurv <- function(x, ...) {
430-
print(x$adjsurv, ...)
431-
}
432-
433427
## S3 summary method for adjustedsurv objects
434428
#' @export
435429
summary.adjustedsurv <- function(object, ...) {
@@ -453,10 +447,6 @@ summary.adjustedsurv <- function(object, ...) {
453447
} else if (object$method=="aiptw_pseudo") {
454448
method_name <- paste0("Augmented Inverse Probability of Treatment",
455449
" Weighting: Pseudo-Values")
456-
} else if (object$method=="tmle") {
457-
method_name <- "Targeted Maximum Likelihood Estimation"
458-
} else if (object$method=="ostmle") {
459-
method_name <- "One-Step Targeted Maximum Likelihood Estimation"
460450
} else if (object$method=="km") {
461451
method_name <- "Kaplan-Meier Estimator"
462452
} else if (object$method=="strat_cupples") {
@@ -504,6 +494,12 @@ summary.adjustedsurv <- function(object, ...) {
504494
}
505495
}
506496

497+
## S3 print method for adjustedsurv objects
498+
#' @export
499+
print.adjustedsurv <- function(x, ...) {
500+
summary(x, ...)
501+
}
502+
507503
## S3 print method for adjustedsurv.method objects
508504
#' @export
509505
print.adjustedsurv.method <- function(x, ...) {

R/helper_functions.r

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -280,12 +280,6 @@ remove_unnecessary_covars <- function(data, method, variable, ev_time,
280280
} else if (method=="aiptw_pseudo") {
281281
needed_covars <- c(needed_covars, args$outcome_vars, args$censoring_vars,
282282
treatment_vars)
283-
} else if (method=="tmle" | method=="ostmle") {
284-
if (!is.null(args$adjust_vars)) {
285-
needed_covars <- c(needed_covars, args$adjust_vars)
286-
} else {
287-
needed_covars <- colnames(data)
288-
}
289283
} else if (method=="strat_cupples" | method=="strat_amato" |
290284
method=="strat_nieto") {
291285
needed_covars <- c(needed_covars, args$adjust_vars)
@@ -347,17 +341,6 @@ load_needed_packages <- function(method, kind, treatment_model,
347341
requireNamespace("MASS")
348342
}
349343

350-
# survtmle, SuperLearner
351-
if (method=="tmle") {
352-
requireNamespace("survtmle")
353-
requireNamespace("SuperLearner")
354-
}
355-
356-
# SuperLearner
357-
if (method=="ostmle") {
358-
requireNamespace("SuperLearner")
359-
}
360-
361344
} else {
362345

363346
# cmprsk
@@ -391,12 +374,6 @@ load_needed_packages <- function(method, kind, treatment_model,
391374
if (method=="direct_pseudo" | method=="aiptw_pseudo") {
392375
requireNamespace("geepack")
393376
}
394-
395-
# survtmle, SuperLearner
396-
if (method=="tmle") {
397-
requireNamespace("survtmle")
398-
requireNamespace("SuperLearner")
399-
}
400377
}
401378
}
402379

R/input_checks.r

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ check_inputs_adjustedsurv <- function(data, variable, ev_time, event, method,
6666
# method
6767
} else if (!method %in% c("km", "iptw_km", "iptw_cox", "iptw_pseudo",
6868
"direct", "direct_pseudo", "aiptw_pseudo",
69-
"aiptw", "tmle", "ostmle", "matching",
69+
"aiptw", "matching",
7070
"emp_lik", "strat_cupples", "strat_amato",
7171
"strat_nieto")) {
7272
stop("Method '", method, "' is undefined. See documentation for ",
@@ -114,8 +114,7 @@ check_inputs_adjustedsurv <- function(data, variable, ev_time, event, method,
114114
levs_len <- length(unique(data[, variable]))
115115
if (levs_len < 2) {
116116
stop("There have to be at least two groups in 'variable'.")
117-
} else if (levs_len > 2 & method %in% c("matching", "emp_lik", "tmle",
118-
"ostmle", "aiptw")) {
117+
} else if (levs_len > 2 & method %in% c("matching", "emp_lik", "aiptw")) {
119118
stop("Categorical treatments are currently not supported for ",
120119
"method='", method, "'.")
121120
}
@@ -248,13 +247,6 @@ check_inputs_adjustedsurv <- function(data, variable, ev_time, event, method,
248247
}
249248
}
250249

251-
## TMLE / OSTMLE
252-
} else if (method=="tmle" | method=="ostmle") {
253-
# times
254-
if (!is.null(times) && (!all(times==floor(times)))) {
255-
stop("Only integer time is allowed when using method='tmle' or",
256-
" method='ostmle'.")
257-
}
258250
## Empirical Likelihood
259251
} else if (method=="emp_lik") {
260252
# need treatment_vars
@@ -677,7 +669,7 @@ check_inputs_adjustedcif <- function(data, variable, ev_time, event, method,
677669
"character strings, specifying variables in 'data'.")
678670
} else if (!method %in% c("aalen_johansen", "iptw", "iptw_pseudo", "direct",
679671
"direct_pseudo", "aiptw_pseudo",
680-
"aiptw", "tmle", "matching")) {
672+
"aiptw", "matching")) {
681673
stop("Method '", method, "' is undefined. See documentation for ",
682674
"details on available methods.")
683675
# conf_int
@@ -750,7 +742,7 @@ check_inputs_adjustedcif <- function(data, variable, ev_time, event, method,
750742
levs_len <- length(unique(data[, variable]))
751743
if (levs_len < 2) {
752744
stop("There have to be at least two groups in 'variable'.")
753-
} else if (levs_len > 2 & method %in% c("matching", "tmle", "aiptw")) {
745+
} else if (levs_len > 2 & method %in% c("matching", "aiptw")) {
754746
stop("Categorical treatments are currently not supported for ",
755747
"method='", method, "'.")
756748
}
@@ -861,11 +853,6 @@ check_inputs_adjustedcif <- function(data, variable, ev_time, event, method,
861853
}
862854
}
863855

864-
## TMLE
865-
} else if (method=="tmle") {
866-
if (!is.null(times) && (!all(times==floor(times)))) {
867-
stop("Only integer time is allowed when using method='tmle'.")
868-
}
869856
## Matching
870857
} else if (method=="matching") {
871858
# treatment_model

0 commit comments

Comments
 (0)