View source: R/CoxKnotSearch.R
| extract_CoxKnotsearch | R Documentation |
This is a function to extract log HR based on the resuls from CoxKnotsearch
extract_CoxKnotsearch(fit, lag, latency)
fit |
A model from CoxKnotsearch |
lag |
A lag time, or a vector of lag times |
latency |
prespecified latency |
A data frame with one row per lag, giving the estimated log HR at each lag time
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.