Transforms data from counting process format to the long format.
Usage
cp2long(data, id, time1, time2, status = NULL, fill = FALSE)
Value
A data frame in long format.
Arguments
data
A data frame with relevant columns.
id
A character string of the identification variable name in data.
time1
A character string of the first time point variable in data. Represents the left endpoint of the time interval.
time2
A character string of the second time point variable in data. Represents the right endpoint of the time interval.
status
A character string of the status column name in data to be treated as either an event or state.
fill
An optional argument that attempts to fill any NA values in the output for columns that might be constant within id levels.
Details
The data transition consolitdates information from the time1 and time2 argument into a single time column. All other columns are assumed to correspond to the time2 point. Thus, the first row generally consists of NA values. The fill argument will attempt to discern any constant columns within id groups in order to populate that first row.