Skip to content

Commit f59e38e

Browse files
committed
Add documentation and example for left_truncation_y
1 parent d4274f2 commit f59e38e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

R/ppc-censoring.R

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,23 @@
5858
#' \donttest{
5959
#' ppc_km_overlay_grouped(y, yrep[1:25, ], group = group, status_y = status_y)
6060
#' }
61+
#' # With left-truncation (delayed entry) times:
62+
#' left_truncation_y <- runif(length(y), min = 0, max = 0.6) * y
63+
#' \donttest{
64+
#' ppc_km_overlay(y, yrep[1:25, ], status_y = status_y,
65+
#' left_truncation_y = left_truncation_y)
66+
#' }
6167
NULL
6268

6369
#' @export
6470
#' @rdname PPC-censoring
6571
#' @param status_y The status indicator for the observations from `y`. This must
6672
#' be a numeric vector of the same length as `y` with values in \{0, 1\} (0 =
6773
#' right censored, 1 = event).
74+
#' @param left_truncation_y Optional parameter that specifies left-truncation
75+
#' (delayed entry) times for the observations from `y`. This must
76+
#' be a numeric vector of the same length as `y`. If `NULL` (default),
77+
#' no left-truncation is assumed.
6878
ppc_km_overlay <- function(
6979
y,
7080
yrep,

0 commit comments

Comments
 (0)