Learn R Programming

compeir (version 1.0)

data.reshape: Reshaping individual patient data

Description

Aggregates individual patient data and combines it in a data.frame format required for irates

Usage

data.reshape(times, events, covar, no.event.code, event.code = NULL, covar.code = NULL)

Arguments

times
Timepoints corresponding to event status for each individual (vector or factor)
events
Event status for each individual (vector or factor)
covar
Event status for each individual (vector or factor)
no.event.code
A character or numerical value that specifies the value in events corresponding to “no event observed”.
event.code
A character or numerical value that specifies the respective competing events in events. If NULL, event.code will be automatically extracted from events
covar.code
A character or numerical value that specifies the respective covariate values in covar. If NULL, covar.code will be automatically extracted from covar

Value

An object of class data.frame of the form data.frame(time, no.event.code, event.code) with row.names given by covar.code and corresponding aggregated data entries.

See Also

irates, CIFplot, mvna, etm

Examples

Run this code
### Example data: 
### Pneumonia on admission in intenive care unit patients

data(sir.adm)

data.reshape(
		times = sir.adm$time, 
		events = sir.adm$status, 
		covar = sir.adm$pneu, 
		no.event.code = "0")

### Example data: 
### Bloodstream infections in stem-cell transplanted patients

data(okiss)

data.reshape(
		times = okiss$time, 
		events = okiss$status, 
		covar = okiss$allo, 
		no.event.code = "11")

Run the code above in your browser using DataLab