Learn R Programming

Cyclops (version 3.5.0)

convertToTimeVaryingCoef: Convert short sparse covariate table to long sparse covariate table for time-varying coefficients.

Description

convertToTimeVaryingCoef convert short sparse covariate table to long sparse covariate table for time-varying coefficients.

Usage

convertToTimeVaryingCoef(shortCov, longOut, timeVaryCoefId)

Value

A long sparse covariate table for time-varying coefficients.

Arguments

shortCov

A data frame containing the covariate with predefined columns (see below).

longOut

A data frame containing the outcomes with predefined columns (see below), output of splitTime.

timeVaryCoefId

Integer: A numeric identifier of a time-varying coefficient

Details

These columns are expected in the shortCov object:

rowId(integer)Row ID is used to link multiple covariates (x) to a single outcome (y)
covariateId(integer)A numeric identifier of a covariate
covariateValue(real)The value of the specified covariate

These columns are expected in the longOut object:

stratumId(integer)Stratum ID for time-varying models
subjectId(integer)Subject ID is used to link multiple covariates (x) at different time intervals to a single subject
rowId(integer)Row ID is used to link multiple covariates (x) to a single outcome (y)
y(real)The outcome variable
time(real)For models that use time (e.g. Poisson or Cox regression) this contains time
(e.g. number of days)