get_outcome_status_at_specific_time: Get outcome status at specific time

View source: R/get_outcome_status_at_specific_time.R

get_outcome_status_at_specific_timeR Documentation

Get outcome status at specific time

Description

Some may want to calculate the outcome status at a specified time to predict the outcome at a specific time. This function gets the outcome status at the specific time.

Usage

get_outcome_status_at_specific_time(df, status_field, time_field, specific_time)

Arguments

df

The dataframe which contains the data.

status_field

The field in the dataframe that indicates the status, i.e., event or no event.

time_field

The field in the dataframe that indicates the follow-up time.

specific_time

The time point at which the outcome status should be calculated.

Value

outcome

Whether the operation was successfully performed

message

Any information, particularly when the operation fails.

new_data

The data with the existing status and time fields replaced by the updated status and time. The original status and time are available with a prefix "unmodified_".

Author(s)

Kurinchi Gurusamy

Examples

library(survival)
# Use the dataset colon as example
# Replace existing status with the status at 365 days
results <- get_outcome_status_at_specific_time(df = colon,
status_field = "status", time_field = "time", specific_time = 365)
results$outcome
results$message
# Display first 10 rows to show how the status and time have been modified
results$new_data[1:10, c("status", "time", "unmodified_status", "unmodified_time")]

EQUALPrognosis documentation built on Feb. 4, 2026, 5:15 p.m.