get.tvcoef {surtvep} | R Documentation |
helper function to get time-varying coefficients
Description
The function gives the time-varying coefficients based on a fitted coxtv
or coxtp
subject.
Users can specify the time points to calculate the time-varying coefficients.
Usage
get.tvcoef(fit, time)
Arguments
fit |
model from |
time |
time points to calculate the time-varying coefficients. If |
Value
A matrix of the time-varying coefficients. The dimension is the length of time
by nvars
, where nvars
is the number
of covariates in the fitted mode.
Each row represents the time-varying coefficients at the corresponding time.
Examples
z <- ExampleData$z
time <- ExampleData$time
event <- ExampleData$event
fit <- coxtv(event = event, z = z, time = time, degree = 2)
coef <- get.tvcoef(fit)
[Package surtvep version 1.0.0 Index]