Plot.Data.Events: Plot data with recurrent events

Description Usage Arguments Details Value Note Author(s) References See Also Examples

View source: R/Plot.Data.Events.R

Description

This function plot data with recurrent events

Usage

1
2
Plot.Data.Events(yy, paciente, inicio, dias, censored,
      especiales,colevent="red",colcensor="blue")

Arguments

yy

Data type recurrent events. Examples: TBCplapyr

paciente

Vector of number of units on the data base

inicio

Vector, its assumed that the units are observed from one time equal to zero.

dias

Vector of the periods of observations of the study untis

censored

vector of times of censorship for each unit

especiales

Three-column matrix containing the identification of the units, times of occurrence of the event and type of event.

colevent

Color event identifier.

colcensor

Color censored data identifier.

Details

The plot shows the recuurence of the events on the time.

Value

This function returned the pictorial representation of the set of recurrence events data

Note

We recommend users to use routines similar to the example.

Author(s)

Dr. Carlos Martinez, <cmmm7031@gmail.com>

References

Mart<ed>nez C., Ram<ed>rez, G., V<e1>squez M. (2009).Pruebas no param<e9>tricas para comparar curvas de supervivencia de dos grupos que experimentan eventos recurrentes. Propuestas. Revista Ingenier<ed>a U.C.,Vol 16, 3, 45-55. Mart<ed>nez, C. (2009). Generalizaci<f3>n de algunas pruebas cl<e1>sicas de comparaci<f3>n de curvas de supervivencia al caso de eventos de naturaleza recurrente. Tesis doctoral.Universidad Central de Venezuela (UCV). Caracas-Venezuela. Pe<f1>a E., Strawderman R., Hollander, M. (2001). Nonparametric Estimation with Recurrent Event Data. J.A.S.A. 96, 1299-1315

See Also

Plot.Surv.Rec,Print.Summary

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
data(TBCplapyr)
 XL<-data.frame(TBCplapyr)
 p<-ncol(XL)
 N<-nrow(XL)
 censor<-matrix(XL$event)
 especiales<-matrix(data=0,nrow(XL),3)
 especiales[,1]<-matrix(XL$id)
 especiales[,2]<-matrix(XL$Tcal)
 especiales[,3]<-matrix(XL$event)
 niveles<-levels(factor(especiales[,1]))
 for(i in 1:N){
 for(j in 1:nrow(matrix(niveles))){
 if (as.character(especiales[i,1])==niveles[j]) especiales[i,1]<-j}}
 StudyPeriod<-matrix(data=0,nrow(matrix(niveles)),1)
 start<-matrix(data=0,nrow(matrix(niveles)),1)
 k<-0
 for(j in 1:N){if (XL$event[j]==0){k<-k+1;StudyPeriod[k,1]<-XL$Tcal[j]}}
 units<-matrix(1:nrow(matrix(niveles)),nrow(matrix(niveles)),1)
 Plot.Data.Events(XL,units,start,StudyPeriod,censor,
								especiales,"black","blue")
Plot.Data.Events(XL,units,start,StudyPeriod,censor,
								especiales,"red","black")
 

TestSurvRec documentation built on May 29, 2017, 8:27 p.m.