expand.data: Function to expand data for regression analysis of interval...

View source: R/expand.data.r

expand.dataR Documentation

Function to expand data for regression analysis of interval censored data.

Description

This is a utility function.

The original records with first.well, last.well and first.ill are expanded to multiple records; several for each interval where the person is known to be well and one where the person is known to fail. At the same time columns for the covariates needed to estimate rates and the response variable are generated.

Usage

expand.data(fu, formula, breaks, data)

Arguments

fu

A 3-column matrix with first.well, last.well and first.ill in each row.

formula

Model fromula, used to derive the model matrix.

breaks

Defines the intervals in which the baseline rate is assumed constant. All follow-up before the first and after the last break is discarded.

data

Datafrem in which fu and formula is interpreted.

Value

Returns a list with three components

rates.frame

Dataframe of covariates for estimation of the baseline rates — one per interval defined by breaks.

cov.frame

Dataframe for estimation of the covariate effects. A data-framed version of the designmatrix from formula.

y

Response vector.

Author(s)

Martyn Plummer, martyn.plummer@r-project.org

References

B Carstensen: Regression models for interval censored survival data: application to HIV infection in Danish homosexual men. Statistics in Medicine, 15(20):2177-2189, 1996.

See Also

Icens fit.mult fit.add


Epi documentation built on April 25, 2023, 9:09 a.m.

Related to expand.data in Epi...