Learn R Programming

lmtp (version 1.5.0)

event_locf: Time To Event Last Outcome Carried Forward

Description

A helper function to prepare survival data for use with LMTP estimators by imputing outcome nodes using last outcome carried forward when an observation experiences the event before the end-of-follow-up.

Usage

event_locf(data, outcomes)

Value

A modified dataset with future outcome nodes set to 1 if an observation experienced an event at any previous time point.

Arguments

data

The dataset to modify.

outcomes

A vector of outcome nodes ordered by time.

Examples

Run this code
event_locf(sim_point_surv, paste0("Y.", 1:6))

Run the code above in your browser using DataLab