File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -91,12 +91,6 @@ ppc_km_overlay <- function(
91
91
92
92
data <- ppc_data(y , yrep , group = status_y )
93
93
94
- if (! is.null(left_truncation_y )) {
95
- data $ left_trunc <- left_truncation_y [data $ y_id ]
96
- } else {
97
- data $ left_trunc <- 0
98
- }
99
-
100
94
# Modify the status indicator:
101
95
# * For the observed data ("y"), convert the status indicator back to
102
96
# a numeric.
@@ -109,7 +103,12 @@ ppc_km_overlay <- function(
109
103
as.numeric(as.character(.data $ group )),
110
104
1 ))
111
105
112
- sf_form <- survival :: Surv(time = data $ left_trunc , time2 = data $ value , event = data $ group ) ~ rep_label
106
+ if (is.null(left_truncation_y )) {
107
+ sf_form <- survival :: Surv(time = data $ value , event = data $ group ) ~ rep_label
108
+ } else {
109
+ sf_form <- survival :: Surv(time = left_truncation_y [data $ y_id ], time2 = data $ value , event = data $ group ) ~ rep_label
110
+ }
111
+
113
112
if (! is.null(add_group )) {
114
113
data <- dplyr :: inner_join(data ,
115
114
tibble :: tibble(y_id = seq_along(y ),
You can’t perform that action at this time.
0 commit comments