pw_cum_mat: Generate Matrix of Values of Integrated Piecewise Constant...

Description Usage Arguments Value

View source: R/pw_cum_mat.R

Description

This helper function takes in a vector of event times, and generates a matrix having each row showing the time accrued within each interval between consecutive elements of a vector of knots.

Usage

1
pw_cum_mat(y, knots, intercept = TRUE)

Arguments

y

vector of event times.

knots

increasing vector of cutpoints. If it does not start with 0, one will be appended to the start. However, it should not include Inf at the end.

intercept

if true, includes column corresponding with 'first' interval, and if false does not. It makes sense to include an intercept if the time-varying covariate is not also included in the "baseline", otherwise, there would be an identifiability issue.

Value

a numeric matrix with, with (number of nonzero knots + 1) columns, and with rows corresponding to elements of y.


harrisonreeder/AFTTV documentation built on Dec. 20, 2021, 2:51 p.m.