extract_CoxKnotsearch: This is a function to extract log HR based on the resuls from...

View source: R/CoxKnotSearch.R

extract_CoxKnotsearchR Documentation

This is a function to extract log HR based on the resuls from CoxKnotsearch

Description

This is a function to extract log HR based on the resuls from CoxKnotsearch

Usage

extract_CoxKnotsearch(fit, lag, latency)

Arguments

fit

A model from CoxKnotsearch

lag

A lag time, or a vector of lag times

latency

prespecified latency

Value

A data frame with one row per lag, giving the estimated log HR at each lag time

Examples

time_start <- "age_start"
time_end <- "age_end"
status <- "failure"
exposure <- paste0("lag", 0:19)
# knots can be set as as a vector of potential number of knots, here we use 3 to save time
knots_number <- c(3)
latency <- 20
fit <- CoxKnotsearch(sim_data, time_start, time_end, status, exposure, knots_number, latency)
extract_CoxKnotsearch(fit, 10, latency = latency)
extract_CoxKnotsearch(fit, c(0, 5, 10), latency = latency)

LatencyA documentation built on Oct. 21, 2026, 5:14 p.m.