get.tvcoef: helper function to get time-varying coefficients

View source: R/get.tvcoef.R

get.tvcoefR 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 coxtv or coxtp.

time

time points to calculate the time-varying coefficients. If NULL, the observed event times for fitting the model will be used.

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)



surtvep documentation built on Oct. 17, 2023, 5:07 p.m.