Learn R Programming

TraMineRextras (version 0.2.2)

createdatadiscrete: Transform time to event data into a discrete data format

Description

Transform time to event data (in a specific format, see the detailed description below) into a person-period data format suitable for automatic sequential association rules extraction

Usage

createdatadiscrete(ids, data, vars, agemin, agemax,
    supvar=NULL)

Arguments

ids
a vector containing an unique identification number for each case
data
a data frame containing time to event data, with variables containing the durations called as in the vars argument, and those with the censoring indicators named as in the vars argument followed by "ST" (for example column A is duration until event A, and
vars
a vector with the names of the duration variables
agemin
a data frame with two variables : "IDPERS" for the unique identification variable, and "AGE" for the starting time of the observation
agemax
a data frame with two variables : "IDPERS" for the unique identification variable, and "AGE" for the ending time of the observation
supvar
a vector of variables to add to the resulting person-period data frame

Value

  • a list with one person-period data frame by event, where the dependent event is different each time. Please see the attached data file and code for an example.

encoding

latin1

Details

The data frame from the data argument must contain two variables for each event: a duration variable that indicates the time when the event occured, and a status variable that indicates if the event occurred (1) or not (0). If the event did not occur, the observation for this individual will go until the age specified through the agemax argument. Each status variable must have the same name than the duration variable, followed by "ST". For example, if the duration variable for an event "divorce" is called "div", then the status variable has to be named "divST". The result from this function is a list with one person-period data frame by event, where the dependent event is different each time. Please see the attached data file and code for an example. The resulting object is one of the required argument for the seqerulesdisc function that computes the association rules, the hazard ratios and the p-values, using discrete-time regressions. Unlike the method presented in M�ller et al. 2010, this function does not use Cox proportional hazard models, but discrete-time regression models with a complementary log-log link function, which gives similar results.

References

M�ller, N.S., M. Studer, G. Ritschard et A. Gabadinho (2010), Extraction de r�gles d'association s�quentielle � l'aide de mod�les semi-param�triques � risques proportionnels, Revue des Nouvelles Technologies de l'Information, Vol. E-19, EGC 2010, pp. 25-36

See Also

seqerulesdisc to compute the association rules.

Examples

Run this code
##

Run the code above in your browser using DataLab