Title: | Statistical Tests to Compare Curves with Recurrent Events |
---|---|
Description: | Implements the routines to compare the survival curves with recurrent events, including the estimations of survival curves. The first model is a model for recurrent event, when the data are correlated or not correlated. It was proposed by Wang and Chang (1999) <doi:10.2307/2669690>. In the independent case, the survival function can be estimated by the generalization of the limit product model of Pena (2001) <doi:10.1198/016214501753381922>. |
Authors: | Dr Carlos Miguel Martinez Manrique |
Maintainer: | Carlos Martinez <[email protected]> |
License: | GPL (>= 2) |
Version: | 1.0.2 |
Built: | 2024-12-04 07:25:18 UTC |
Source: | CRAN |
package newTestSurvRec
Recurrent events are common in many areas: psychology, engineering, medicine, physics, astronomy, biology, economics and so on. Such events are very common in the real world: viral diseases, carcinogenic tumors, machinery and equipment failures, births, murders, rain, industrial accidents, car accidents and so on. The availability of computerized tools for the analysis is indispensable. The survival analysis is a branch of statistics that allows us to model the time until the occurrence of an events. In general, the objectives of analysis are: the modeling of the survival function to estimate the risk or benefit of the occurrence of an event, the probability occurrence of this event and comparing population groups. The development of tools for the statistical analysis of recurrent event is relatively recent and are not fully known. The purpose of this package is to present statistical tests for the analysis of recurrent event data. Martinez et al. (2009) published a statistical test to compare survival curves of two groups with recurrent events. The hypothesis of the problem is:
Where, and
are the survival curves of the both group. The statistic of test is,
The statistic Z has a normal asymptotic behavior. Its square has a chi-square approximate behavior with a degree of freedom. So,
Now, is approaches to zero and as
has a hyper-geometric behavior and expected value is equal to
and variance equal to,
This author proposed various types of weights ,
The appropriate selection of weights depends on the behavior of the curves. With the selection of the values of the parameters , on the proposal, is possible adjust its behavior. With the proposal, we are able of make studies on survival analysis with recurrent events and generate tests for analysis others, including the classical tests type: logrank, Gehan, Peto-Peto, Fleming-Harrington and so on. Note that, if all parameters are zero,
, its generates the test type logrank for recurrent events. If,
and the other parameters are zero
, its generates the test type Gehan. If,
and the other parameters are zero
, its generate the test of Peto-Peto. If,
and
and the rest of the parameters are zero, its generate Fleming-Harrington test. On the other hand, if you analyze the test statistical of comparison for recurrent events, it depends on the counting processes N and Y, which are doubles indexed. The index S measures calendar time and Z index measures the gap times. So, if the observation time tends to infinity and unity event study can only occur once in each unit and the statistical comparison becomes the weighted classical statistical comparison of groups of the survival analysis. We can conclude that test proposed by Martinez et al.(2009) are useful on diverse fields of research, such as: medicine, public health, insurance, social science, reliability and others.
This package have some functions that them were originally performed by the survrec package, which solved the adjustment problem of the PSH and WC estimators using Fortran routines. With the permission of the author, Dr. Juan R. Gonzalez, the algorithm of base was taken, modified, the algorithm, WC estimator was reprogrammed and adapted to the needs of the newTestSurvRec package and thus avoid dependence. Thanks to Dr. Gonzalez
Dr. Carlos M. Martinez M., <[email protected]>
Martinez C., Ramirez, G., Vasquez M. (2009).Pruebas no parametricas para comparar curvas de supervivencia de dos grupos que experimentan eventos recurrentes. Propuestas. Revista Ingenieria U.C.,Vol 16, 3, 45-55.// Martinez, C. (2009). Generalizacion de algunas pruebas clasicas de comparacion de curvas de supervivencia al caso de eventos de naturaleza recurrente. Tesis doctoral. Universidad Central de Venezuela (UCV). Caracas-Venezuela.// Pena E., Strawderman R., Hollander, M. (2001). Nonparametric Estimation with Recurrent Event Data. J.A.S.A. 96, 1299-1315.
Dif.Surv.Rec, Plot.Event, Rec,Plot.Surv. Rec, Print.Summary, Plot.Cusum.Events
##library(newTestSurvRec) getOption("defaultPackages") XL<-data(TBCplapyr) XL Plot.Event.Rec(TBCplapyr) Dif.Surv.Rec(TBCplapyr,'all',1,1,0,0) Print.Summary(TBCplapyr)
##library(newTestSurvRec) getOption("defaultPackages") XL<-data(TBCplapyr) XL Plot.Event.Rec(TBCplapyr) Dif.Surv.Rec(TBCplapyr,'all',1,1,0,0) Print.Summary(TBCplapyr)
This data set contains the re-hospitalization times of patients diagnosed with stage AB and patients diagnosed with stage C.
data(DataColonDukesABvsC)
data(DataColonDukesABvsC)
A data frame with 655 observations on the following 10 variables.
This data.frame contains the following columns
j
Observation number
Iden
identification of each subject. Repeated for each recurrence
id
identification of each subject. Repeated for each recurrence
Tinicio
Initial time of observation just before each recurrence
time
re-hospitalization o censoring gaptime
Tcal
re-hospitalization o censoring calendar time
event
censoring status. All event are 1 for each subject excepting last one that it is 0
chemoter
Did patient receive chemotherapy? 1: No or 2:Yes
dukes
Dukes tumor stage: 1:A-B or 2:C
distance
distance from living place to hospital 1:<=30 Km. or 2:>30 Km.
The patients included in the study have been operated between January 1996 and December 1998. For each patient, we have considered this date as the beginning of the observational period. All patients were followed until June 2002. Consequently, the length of the monitoring period can differ for each patient, depending on its surgery date. The first inter occurrence time has been considered as the time between the surgical intervention and the first hospitalization related to cancer. Four hundred and three patients with colon and rectum cancer have been included in the study. Information about their sex (male or female), age ( 60, 60-74 or 75), and tumor stage using Dukes classification (A-B, C, or D) have been recorded. The following inter- occurrence times have been considered as the difference between the last hospitalization and the current one. Only re-admissions related to cancer have been considered.
This data were obtained from Gonzalez, J.R. et al. (2009)
Martinez C., Ramirez, G., Vasquez M. (2009). Pruebas no parametricas para comparar curvas de supervivencia de dos grupos que experimentan eventos recurrentes. Propuestas. Revista Ingenieria U.C.,Vol 16, 3, 45-55.// Martinez, C. (2009). Generalizacion de algunas pruebas clasicas de comparacion de curvas de supervivencia al caso de eventos de naturaleza recurrente. Tesis doctoral. Universidad Central de Venezuela (UCV). Caracas-Venezuela.//Gonzalez, J.R., Fernandez, E., Moreno, V. et al. Gender differences in hospital readmission among colorectal cancer patients. Currently submited to J.C.O.
data(DataColonDukesABvsC)
data(DataColonDukesABvsC)
This data contains re-hospitalization times of patients diagnosed with stage AB and patients diagnosed with stage D.
data(DataColonDukesABvsD)
data(DataColonDukesABvsD)
A data frame with 527 observations on the following 10 variables
This data.frame contains the following columns:
j
Observation number
Iden
Observation of each subject. Repeated for each recurrence
id
Observation of each subject. Repeated for each recurrence
Tinicio
Initial time of observation just before each recurrence
time
re-hospitalization o censoring gaptime
Tcal
re-hospitalization o censoring calendar time
event
censoring status. All event are 1 for each subject excepting last one that it is 0
chemoter
Did patient receive chemotherapy? 1: No or 2:Yes
dukes
Dukes tumoral stage: 1:A-B or 3:D
distance
distance from living place to hospital 1:<=30 Km. or 2:>30 Km.
See details on DataColonDukesABvs
This data were obtained from Gonzalez, J. R. et al. (2009)
Martinez, C. (2009). Generalizacion de algunas pruebas clasicas de comparacion de curvas de supervivencia al caso de eventos de naturaleza recurrente. Tesis doctoral. Universidad Central de Venezuela (UCV). Caracas-Venezuela.// Gonzalez, J.R., Fernandez, E., Moreno, V. et al. Gender differences in hospital readmission among colorectal cancer patients. Currently submited to J.C.O.
data(DataColonDukesABvsD) XL<-data(DataColonDukesABvsD) print(XL)
data(DataColonDukesABvsD) XL<-data(DataColonDukesABvsD) print(XL)
This data contains the re-hospitalization times of patients diagnosed with stage C and patients diagnosed with stage D
data(DataColonDukesCvsD)
data(DataColonDukesCvsD)
A data frame with 537 observations on the following 10 variables
This data.frame contains the following columns
j
Observation number
Iden
identification of each subject. Repeated for each recurrence
id
identification of each subject. Repeated for each recurrence
Tinicio
Initial time of observation just before each recurrence
time
re-hospitalization o censoring gaptime
Tcal
re-hospitalization o censoring calendar time
event
censoring status. All event are 1 for each subject excepting last one that it is 0
chemoter
Did patient receive chemotherapy? 1: No or 2:Yes
dukes
Dukes tumor stage: 2:C or 3:D
distance
distance from living place to hospital 1:=30 Km. or 2:
30 Km.
See details on DataColonDukesABvs
This data were obtained from Gonzalez, J.R. et al. (2009)
Martinez, C. (2009). Generalizacion de algunas pruebas clasicas de comparacion de curvas de supervivencia al caso de eventos de naturaleza recurrente. Tesis doctoral. Universidad Central de Venezuela (UCV). Caracas-Venezuela.//Gonzalez, J.R., Fernandez, E., Moreno, V. et al. Gender differences in hospital re-admission among colorectal cancer patients. Currently submited to J.C.O.
data(DataColonDukesCvsD) XL<-data(DataColonDukesCvsD) print(XL)
data(DataColonDukesCvsD) XL<-data(DataColonDukesCvsD) print(XL)
p-values of these tests are computed.
Dif.Surv.Rec(XX, type, alfa, beta,gamma,eta)
Dif.Surv.Rec(XX, type, alfa, beta,gamma,eta)
XX |
Object type recurrent events data |
type |
"LRrec","Grec","TWrec","PPrec","PMrec","FHrec","CMrec","Mrec","all" |
alfa |
The appropriate choice, see |
beta |
The appropriate choice, see |
gamma |
The appropriate choice, see |
eta |
The appropriate choice, see |
This function contains tests to compare survival curves with recurrent events. The curves are estimated using Pena-Strawderman-Hollander or Wang-Chang estimator. GPLE or PSH model: Pena et al. (2001) defined an estimator of the survival function to recurrent events or Kaplan-Meier estimator GPLE. They used two counting processes N and Y. The PSH estimator was defined as,
The authors considered two time scales: one related to calendar time (S) and other related to inter occurrences time (T). So, the counting process N(s, z) represents the number of observed events in the calendar period with
and Y(s, z) represents the number of observed events in the period
with
. The product-limit estimator was developed by Pena, Strawderman and Hollander, called PSH. This estimator is useful when the inter occurrence times are assumed to
represents IID sample from some underlying distribution F. The GPLE estimator is defined as: A fundamental assumption of this approach is that individuals have been previously and properly classified in groups according to a stratification variable denote by r. Thus, the estimator of the survival curve by each group is defined as,
WC model: Wang-Chang (1999) proposed an estimator of the common marginal survivor function in the case where within-unit inter occurrences times are correlated. The correlation structure considered by Wang and Chang (1999) is quite general and contains, the cases particular, both the i.i.d. and multiplicative frailty model as special cases. The WC estimator was defined using two new processes, and
.
The authors try take into account in the definition of and
that an individual may have more than one event. In fact, this estimator has the same way as the GPLE estimator but using these two different processes. the index
represents the sum of the proportion of individuals of the inter occurrences times which are equal to
when there is at least one event. On the other hand,
represents an average of the individuals that are at risk time
, where for each individual the average is the number of failures or censored times at least equal to
. This average is done regarding the number of events that there are to each individual and in case
is 0 is divided by 1. For definition more formal see Martinez (2009) and Pena et. al (2001). The WC estimator of S eliminates the bias for the product-limit estimator developed by PSH (2001) when the inter occurrences times are correlated within units.However, when applied to i.i.d. inter occurrence times, this estimator is not expected to perform as well as the PSH estimator, especially with regard to efficiency.
# Dif.Surv.Rec(TBCplapyr,"all",0,0,0,0). Values returned
Nomb.Est | Chi.square | p.value |
LRrec | 0.3052411 | 0.5806152 |
Grec | 1.4448446 | 0.2293570 |
TWrec | 0.9551746 | 0.3284056 |
PPrec | 1.1322772 | 0.2872901 |
PMrec | 1.1430319 | 0.2850126 |
PPrrec | 1.1834042 | 0.2766641 |
HFrec | 0.3052411 | 0.5806152 |
CMrec | 0.3052411 | 0.5806152 |
Mrec | 1.5298763 | 0.2161310 |
Dr. Carlos M. Martinez M., <[email protected]>
Martinez C., Ramirez, G., Vasquez M. (2009).Pruebas no parametricas para comparar curvas de supervivencia de dos grupos que experimentan eventos recurrentes. Propuestas. Revista Ingenieria U.C.,Vol 16, 3, 45-55.//Martinez, C. (2009). Generalizacion de algunas pruebas clasicas de comparacion de curvas de supervivencia al caso de eventos de naturaleza recurrente. Tesis doctoral. Universidad Central de Venezuela (UCV). Caracas-Venezuela.
Plot.Event.Rec, Plot.Surv.Rec, Print.Summary
data(TBCplapyr) #Return the p-values of the all tests Dif.Surv.Rec(TBCplapyr,"all",0,0,0,0) #Return the p-value of the LRrec test Dif.Surv.Rec(TBCplapyr) #Return the p-value of the Grec test Dif.Surv.Rec(TBCplapyr,"Grec") #Return the p-values of the CMrec tests #The CMrec test with this parameters generates LRrec test Dif.Surv.Rec(TBCplapyr,"all",0,0,0,0) #The CMrec test with this parameters generates Grec test Dif.Surv.Rec(TBCplapyr,"all",0,0,1,0) #The CMrec test with this parameters generates TWrec test Dif.Surv.Rec(TBCplapyr,"all",0,0,0.5,0)
data(TBCplapyr) #Return the p-values of the all tests Dif.Surv.Rec(TBCplapyr,"all",0,0,0,0) #Return the p-value of the LRrec test Dif.Surv.Rec(TBCplapyr) #Return the p-value of the Grec test Dif.Surv.Rec(TBCplapyr,"Grec") #Return the p-values of the CMrec tests #The CMrec test with this parameters generates LRrec test Dif.Surv.Rec(TBCplapyr,"all",0,0,0,0) #The CMrec test with this parameters generates Grec test Dif.Surv.Rec(TBCplapyr,"all",0,0,1,0) #The CMrec test with this parameters generates TWrec test Dif.Surv.Rec(TBCplapyr,"all",0,0,0.5,0)
This function let to adjust the ID's the database in case that it is not have the order numeric correct. Observation: this function only let to adjust the id variable not sort the rest of the data.
fit.Data.Survrecu(x)
fit.Data.Survrecu(x)
x |
a database type dataframe |
Returns the correct numeric order for the dataframe
The last id on each unit of the database to have be a censored data and the occurrences have that to precede to this last it.
Dr. Carlos M. Martinez M., <[email protected]>
Martinez C., Ramirez, G., Vasquez M. (2009).Pruebas no parametricas para comparar curvas de supervivencia de dos grupos que experimentan eventos recurrentes. Propuestas. Revista Ingenieria U.C.,Vol 16, 3, 45-55.//Pena E., Strawderman R., Hollander M. (2001). Nonparametric Estimation with Recurrent Event Data. J.A.S.A. 96, 1299-1315
FitSurvRec, Survrecu, is.Survrecu
data(MMC.TestSurvRec) ID<-fit.Data.Survrecu(Survrecu(MMC.TestSurvRec$id,MMC.TestSurvRec$time, MMC.TestSurvRec$event)) ID fit<-PSH.fit(Survrecu(ID,MMC.TestSurvRec$time, MMC.TestSurvRec$event)) fit$time fit$surv plot(fit$time,fit$surv) data(DataColonDukesABvsD) XL<-data(DataColonDukesABvsD) DataColonDukesABvsD$Iden Y<-fit.Data.Survrecu(Survrecu(DataColonDukesABvsD$Iden,DataColonDukesABvsD$time, DataColonDukesABvsD$event)) Y fit<-WC.fit(Survrecu(Y,DataColonDukesABvsD$time,DataColonDukesABvsD$event)) fit$time fit$surv plot(fit$time,fit$surv) print(data.frame(time=fit$time,n.event=fit$n.event, Surv=fit$survfunc,std.error=fit$std.error))
data(MMC.TestSurvRec) ID<-fit.Data.Survrecu(Survrecu(MMC.TestSurvRec$id,MMC.TestSurvRec$time, MMC.TestSurvRec$event)) ID fit<-PSH.fit(Survrecu(ID,MMC.TestSurvRec$time, MMC.TestSurvRec$event)) fit$time fit$surv plot(fit$time,fit$surv) data(DataColonDukesABvsD) XL<-data(DataColonDukesABvsD) DataColonDukesABvsD$Iden Y<-fit.Data.Survrecu(Survrecu(DataColonDukesABvsD$Iden,DataColonDukesABvsD$time, DataColonDukesABvsD$event)) Y fit<-WC.fit(Survrecu(Y,DataColonDukesABvsD$time,DataColonDukesABvsD$event)) fit$time fit$surv plot(fit$time,fit$surv) print(data.frame(time=fit$time,n.event=fit$n.event, Surv=fit$survfunc,std.error=fit$std.error))
Computes an estimate of a survival curve for recurrent event data using either the Pena, Strawderman and Hollanderor Wang and Chang estimators. It also computes the asymptotic standard errors. The resulting object of class Survrecu is plotted.
FitSurvRec(formula, data, type = "pena-strawderman-hollander", ...)
FitSurvRec(formula, data, type = "pena-strawderman-hollander", ...)
formula |
A formula object. If a formula object is supplied it must have a Survrecu object as the response on the left of the operatorand a term on the right. For a single survival curve as part of the formula is required. |
data |
a data frame in wich to interpret the variables named in the formula. |
type |
a character string specifying the type of survival curve. Possible value are "pena- strawderman-hollander" or "wang-chang". The default is "pena,-strawderman-hollander". |
... |
additional arguments passed to the type of estimator. |
See the help details of PSH.fit or WC.fit depending on the type chosen
A FitSurvRec object. Methods defined for FitSurvRec objects are provided for print, lines and plot.
Dr. Carlos M. Martinez M., <[email protected]>
Martinez C., Ramirez, G., Vasquez M. (2009).Pruebas no parametricas para comparar curvas de supervivencia de dos grupos que experimentan eventos recurrentes. Propuestas. Revista Ingenieria U.C.,Vol 16, 3, 45-55.//Pena E., Strawderman R., Hollander M. (2001). Nonparametric Estimation with Recurrent Event Data. J.A.S.A. 96, 1299-1315
is.Survrecu, Survrecu, PSH.fit, Plot.Event.Rec, Plot.Surv.Rec, Print.Summary
data(MMC.TestSurvRec) # fit a PSH survival function and plot it fitPSH<-FitSurvRec(Survrecu(id,time,event)~1,data=MMC.TestSurvRec) plot(fitPSH$time,fitPSH$survfunc,type="s" ,ylim=c(0,1), xlim=c(0,max(fitPSH$time))) title(main = list("Survival Curve with Recurrent Event Data", cex = 0.8, font = 2.3, col = "dark blue")) mtext("Research Group: AVANCE USE R!", cex = 0.7, font = 2, col = "dark blue", line = 1) mtext("Software made by: Dr. Carlos Martinez", cex = 0.6, font = 2, col = "dark red", line = 0) fitWC<-FitSurvRec(Survrecu(id,time,event)~1,data=MMC.TestSurvRec, type="wang-chang") plot(fitWC$time,fitWC$survfunc,type="s" ,ylim=c(0,1),xlim=c(0,max(fitWC$time))) title(main = list("Survival Curve with Recurrent Event Data", cex = 0.8, font = 2.3, col = "dark blue")) mtext("Research Group: AVANCE USE R!", cex = 0.7, font = 2, col = "dark blue", line = 1) mtext("Software made by: Dr. Carlos Martinez", cex = 0.6, font = 2, col = "dark red", line = 0)
data(MMC.TestSurvRec) # fit a PSH survival function and plot it fitPSH<-FitSurvRec(Survrecu(id,time,event)~1,data=MMC.TestSurvRec) plot(fitPSH$time,fitPSH$survfunc,type="s" ,ylim=c(0,1), xlim=c(0,max(fitPSH$time))) title(main = list("Survival Curve with Recurrent Event Data", cex = 0.8, font = 2.3, col = "dark blue")) mtext("Research Group: AVANCE USE R!", cex = 0.7, font = 2, col = "dark blue", line = 1) mtext("Software made by: Dr. Carlos Martinez", cex = 0.6, font = 2, col = "dark red", line = 0) fitWC<-FitSurvRec(Survrecu(id,time,event)~1,data=MMC.TestSurvRec, type="wang-chang") plot(fitWC$time,fitWC$survfunc,type="s" ,ylim=c(0,1),xlim=c(0,max(fitWC$time))) title(main = list("Survival Curve with Recurrent Event Data", cex = 0.8, font = 2.3, col = "dark blue")) mtext("Research Group: AVANCE USE R!", cex = 0.7, font = 2, col = "dark blue", line = 1) mtext("Software made by: Dr. Carlos Martinez", cex = 0.6, font = 2, col = "dark red", line = 0)
To verify if the create object type Survrecu is a formula model type newTestSurvRec
is.Survrecu(x)
is.Survrecu(x)
x |
Object type formula of the class newTestSurvRec |
False |
if the object is not type formula |
True |
if the object is type formula |
Dr. Carlos M. Martinez M., <[email protected]>
Martinez, C. (2009). Generalizacion de algunas pruebas clasicas de comparacion de curvas de supervivencia al caso de eventos de naturaleza recurrente. Tesis doctoral. Universidad Central de Venezuela (UCV). Caracas-Venezuela.// Pena E., Strawderman R., Hollander, M. (2001). Nonparametric Estimation with Recurrent Event Data. J.A.S.A. 96, 1299-1315
FitSurvRec, Dif.Surv.Rec, Survrecu, FitSurvRec
data(MMC.TestSurvRec) x<-Survrecu(MMC.TestSurvRec$id,MMC.TestSurvRec$time,MMC.TestSurvRec$event)~1 is.Survrecu(x)
data(MMC.TestSurvRec) x<-Survrecu(MMC.TestSurvRec$id,MMC.TestSurvRec$time,MMC.TestSurvRec$event)~1 is.Survrecu(x)
This contains the Migratoty Motor Complex data
data(MMC.TestSurvRec)
data(MMC.TestSurvRec)
A data frame with 99 observations on the following 5 variables.
j
Number of the observation on dataset
id
ID of each subject. Repeated for each recurrence
time
recurrence o censoring time
event
censoring status. All event are 1 for each subject excepting last one that it is 0
group
A factor with levels Females
Males
The data correspond a study from the Section for Gastroenterology of Department of Internal Medicine, Ulleal University Hospital of Oslo.
Husebye E, Skar V, Aalen O. and Osnes M (1990), Digestive Diseases and Sciences.
Husebye E, Skar V, Aalen O.O., Osnes M.(1990). Digital ambulatory manometry of the small intestine in healthy adults. Estimates of variation within and between individuals and statistical management of incomplete MMC periods. Digestive Diseases and Sciences.35:1057: 65.
data(MMC.TestSurvRec) XL<-data(MMC.TestSurvRec) print(XL) Print.Summary(MMC.TestSurvRec) ## maybe str(MMC.TestSurvRec) ; plot(MMC.TestSurvRec) ...
data(MMC.TestSurvRec) XL<-data(MMC.TestSurvRec) print(XL) Print.Summary(MMC.TestSurvRec) ## maybe str(MMC.TestSurvRec) ; plot(MMC.TestSurvRec) ...
This function plot data with recurrent events
Plot.Cusum.Events(yy, xy = 1, xf= 1, colevent = "blue", colcensor = "red", ltyx = 1, lwdx = 1)
Plot.Cusum.Events(yy, xy = 1, xf= 1, colevent = "blue", colcensor = "red", ltyx = 1, lwdx = 1)
yy |
Data type recurrent events. Examples: TBCplapyr, TBCplathi or TBCpyrthi |
xy |
Initial unit to start the plotted |
xf |
Final unit of the plotted |
colevent |
It is color that identifies the event |
colcensor |
it is color that identifies the censor |
ltyx |
The line type. Line types can either be specified as an integer (0 |
lwdx |
The line width, a positive number, defaulting to 1. The interpretation is device-specific, and some devices do not implement line widths less than one. (See the help on the device for details of the interpretation.) |
This function print and plot as max 5 units each intent.
Print the data correspond to the selects units
This graph is useful because it facilitates the processes of counting in the units
Dr. Carlos M. Martinez M., <[email protected]>
Martinez, C. (2009). Generalizacion de algunas pruebas clasicas de comparacion de curvas de supervivencia al caso de eventos de naturaleza recurrente. Tesis doctoral. Universidad Central de Venezuela (UCV). Caracas-Venezuela.
Plot.Data, Events, Plot. Surv.Rec
XL<-data(TBCplapyr) #TBCplapyr # See, the unit number 1 to 24 Plot.Cusum.Events(TBCplapyr,1,24,"green","red",2,1) # See, the unit number 10 to 12 Plot.Cusum.Events(TBCplapyr,10,12,"pink","blue",1,3) # See, the unit number 5 to 9 Plot.Cusum.Events(TBCplapyr,5,11,,,2,3)
XL<-data(TBCplapyr) #TBCplapyr # See, the unit number 1 to 24 Plot.Cusum.Events(TBCplapyr,1,24,"green","red",2,1) # See, the unit number 10 to 12 Plot.Cusum.Events(TBCplapyr,10,12,"pink","blue",1,3) # See, the unit number 5 to 9 Plot.Cusum.Events(TBCplapyr,5,11,,,2,3)
This function plot data with recurrent events
Plot.Data.Events(yy, paciente, inicio, dias, censored, especiales, colevent="red",colcensor="blue")
Plot.Data.Events(yy, paciente, inicio, dias, censored, especiales, colevent="red",colcensor="blue")
yy |
Data type recurrent events. Examples: TBCplapyr, TBCplathi or TBCpyrthi |
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 of study in each observation, the times of occurrence of the event or censorship and type of event. |
colevent |
Color event identifier. |
colcensor |
Color censored data identifier. |
The plot shows the recuurence of the events on the time
This function returned the pictorial representation of the set of recurrence events data
We recommend users to use routines similar to the example.
Dr. Carlos M. Martinez M., <[email protected]>
Martinez C., Ramirez, G., Vasquez M. (2009).Pruebas no parametricas para comparar curvas de supervivencia de dos grupos que experimentan eventos recurrentes. Propuestas. Revista Ingenieria U.C.,Vol 16, 3, 45-55.// Martinez, C. (2009). Generalizacion de algunas pruebas clasicas de comparacion de curvas de supervivencia al caso de eventos de naturaleza recurrente. Tesis doctoral. Universidad Central de Venezuela (UCV). Caracas-Venezuela.
Dif.Surv.Rec, Plot.Surv.Rec, Print.Summary
data(TBCplapyr) XL<-data(TBCplapyr) p<-ncol(TBCplapyr) N<-nrow(TBCplapyr) censor<-matrix(TBCplapyr$event) especiales<-matrix(data=0,nrow(TBCplapyr),3) especiales[,1]<-matrix(TBCplapyr$id) especiales[,2]<-matrix(TBCplapyr$Tcal) especiales[,3]<-matrix(TBCplapyr$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 (TBCplapyr$event[j]==0){k<-k+1;StudyPeriod[k,1]<-TBCplapyr$Tcal[j]}} units<-matrix(1:nrow(matrix(niveles)),nrow(matrix(niveles)),1) Plot.Data.Events(TBCplapyr,units,start,StudyPeriod,censor,especiales,"black","blue") Plot.Data.Events(TBCplapyr,units,start,StudyPeriod,censor,especiales,"red","black")
data(TBCplapyr) XL<-data(TBCplapyr) p<-ncol(TBCplapyr) N<-nrow(TBCplapyr) censor<-matrix(TBCplapyr$event) especiales<-matrix(data=0,nrow(TBCplapyr),3) especiales[,1]<-matrix(TBCplapyr$id) especiales[,2]<-matrix(TBCplapyr$Tcal) especiales[,3]<-matrix(TBCplapyr$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 (TBCplapyr$event[j]==0){k<-k+1;StudyPeriod[k,1]<-TBCplapyr$Tcal[j]}} units<-matrix(1:nrow(matrix(niveles)),nrow(matrix(niveles)),1) Plot.Data.Events(TBCplapyr,units,start,StudyPeriod,censor,especiales,"black","blue") Plot.Data.Events(TBCplapyr,units,start,StudyPeriod,censor,especiales,"red","black")
Recurrent events are plotted. A plot is returned. The counting processes are a powerful tools in survival analysis. These process consider two scale time, a calendar time and a gap time. This idea originally provides from Gill (1981) and the concept was extended by Pena et al. (2001).
Plot.Event.Rec(yy, xy, xf)
Plot.Event.Rec(yy, xy, xf)
yy |
Object type recurrent events data. Example: TBCplapyr |
xy |
Identification of the unit to plotted. 'xy = 1' is defect value. |
xf |
Argument to plot the ocurrent events of the unit 'xf'. 'xf = 1' is defect value. |
Plot is returned. Pena et al. (2001) designed a special graphic, that allows to count the occurrence of events per unit time. Doubly-indexed processes illustration for an case. The graphic shows a case followed during 24.01 months. This patient presents four recurrences at months 7, 10, 16 and 24 from the beginning of study. This fact implies that interoccurrence. times are 7, 3, 6, 8 and the censored time correspond to 0.01 months. Let us assume that we are interested in computing the single processes, N(t) and Y (t) for a selected interoccurrence time t = 5. In this case N(t = 5) = 1 and Y (t = 5) = 3. For the calendar time scale, s = 20, we have N(s = 20) = 3 and Y (s = 20) = 1. Now, let us assume that we would like to know double-indexed processes for both selected interoccurrence and calendar times. Using both time scales we observe that ,
and
.
Dr. Carlos M. Martinez M. <[email protected]>
Martinez, C. (2009). Generalizacion de algunas pruebas clasicas de comparacion de curvas de supervivencia al caso de eventos de naturaleza recurrente. Tesis doctoral. Universidad Central de Venezuela (UCV). Caracas-Venezuela.// Pena E., Strawderman R., Hollander, M. (2001). Nonparametric Estimation with Recurrent Event Data. J.A.S.A. 96, 1299-1315.// Gill, R. (1981) Testing with replacement and the product-limit estimator. Ann. Statist., 9, 853-860.
Dif.Surv.Rec, Plot.Data.Events
XL<-data(TBCplapyr) # See, the unit number 14 Plot.Event.Rec(TBCplapyr,14,14) # See, the unit number 5 Plot.Event.Rec(TBCplapyr,5,5)
XL<-data(TBCplapyr) # See, the unit number 14 Plot.Event.Rec(TBCplapyr,14,14) # See, the unit number 5 Plot.Event.Rec(TBCplapyr,5,5)
The survival curves are plotted. Both curves are estimates using PSH o WC estimator. This package is available in language R. This important clearly, that the PHS estimator is of valid use when it assumed that the inter-occurrence times are IID. Its obvious that this assumption is restrictive in biomedical applications and its use is more valid on the field of engineering. For WC estimated not import if the data is correlated.
Plot.Surv.Rec(XX,...)
Plot.Surv.Rec(XX,...)
XX |
Data type recurrent events. Example: TBCplapyr |
... |
Other objects |
The survival curves for both groups are plotted.
Dr. Carlos M. Martinez M. <[email protected]>
Martinez C., Ramirez, G., Vasquez M. (2009).Pruebas no parametricas para comparar curvas de supervivencia de dos grupos que experimentan eventos recurrentes. Propuestas. Revista Ingenieria U.C.,Vol 16, 3, 45-55.// Pena E., Strawderman R., Hollander M. (2001). Nonparametric Estimation with Recurrent Event Data. J.A.S.A. 96, 1299-1315.
Plot.Event.Rec, Dif.Surv.Rec
XL<-data(TBCplapyr) Plot.Surv.Rec(TBCplapyr)
XL<-data(TBCplapyr) Plot.Surv.Rec(TBCplapyr)
Returns matrices that contain the estimations of the survival curves for both groups. The estimations of survival curves of both groups are made using PSH estimator. The p.values of the tests are returned.
Print.Summary(XX,...)
Print.Summary(XX,...)
XX |
Object type recurrent events data |
... |
other objects |
See Dif.Surv.Rec(XX,...)
Put object type recurrent events data. #Print.Summary(TBCplapyr). #Values returned:
time | n.event | n.risk | Surv_G1 | std.error |
1 | 2 | 127 | 0.984 | 0.0110 |
2 | 9 | 124 | 0.913 | 0.0243 |
3 | 14 | 113 | 0.800 | 0.0340 |
4 | 9 | 98 | 0.726 | 0.0380 |
... | .. | .. | ..... | ...... |
... | .. | .. | ..... | ...... |
29 | 1 | 18 | 0.244 | 0.0422 |
31 | 1 | 13 | 0.225 | 0.0427 |
35 | 1 | 9 | 0.200 | 0.0439 |
time | n.event | n.risk | Surv_G2 | std.error |
1 | 3 | 84 | 0.964 | 0.0199 |
2 | 6 | 81 | 0.893 | 0.0327 |
3 | 12 | 73 | 0.746 | 0.0447 |
4 | 10 | 61 | 0.624 | 0.0494 |
... | .. | .. | ..... | ...... |
... | .. | .. | ..... | ...... |
15 | 1 | 17 | 0.283 | 0.0514 |
42 | 1 | 6 | 0.236 | 0.0582 |
44 | 1 | 5 | 0.189 | 0.0599 |
Group Median
Group | Median |
Pooled Group | 8 |
1er Group | 9 |
2do Group | 6 |
Nomb.Est | Chi.square | p.value |
LRrec | 0.3052411 | 0.5806152 |
Grec | 1.4448446 | 0.2293570 |
TWrec | 0.9551746 | 0.3284056 |
PPrec | 1.1322772 | 0.2872901 |
PMrec | 1.1430319 | 0.2850126 |
PPrrec | 1.1834042 | 0.2766641 |
HFrec | 0.3052411 | 0.5806152 |
CMrec | 0.3052411 | 0.5806152 |
Mrec | 1.5298763 | 0.2161310 |
Dr. Carlos M. Martinez M. <[email protected]>
Martinez, C. (2009). Generalizacion de algunas pruebas clasicas de comparacion de curvas de supervivencia al caso de eventos de naturaleza recurrente. Tesis doctoral. Universidad Central de Venezuela (UCV). Caracas-Venezuela.
Dif.Surv.Rec, Plot.Surv.Rec
data(TBCplapyr) Print.Summary(TBCplapyr)
data(TBCplapyr) Print.Summary(TBCplapyr)
Estimation of survival function for recurrence time data by means the generalized product limit estimator (PLE) method developed by Pena, Strawderman and Hollander. The resulting object of class Survrecu is plotted by plot, before it is returned.
PSH.fit(x, tvals)
PSH.fit(x, tvals)
x |
a survival recurrent event object |
tvals |
vector of times where the survival function can be estimated. |
The estimator computed by this object is the nonparametric estimator of the inter-event time survivor function under the assumption of a renewal or IID model. This generalizes the product-limit estimator to the situation where the event is recurrent. For details and the theory behind this estimator, please refer to Pena, Strawderman and Hollander (2001, JASA).
Value returned
n |
number of unit or subjects observed. |
m |
vector of number of recurrences in each subject (length n) |
failed |
vector of number of recurrences in each subject (length n*m). Vector ordered (e.g. times of first unit, times of second unit, ..., times of n-unit) |
censored |
vector of times of censorship for each subject (length n) |
numdistinct |
number of distinct failures times. |
distinct |
vector of distinct failures times. |
AtRisk |
matrix of number of persons-at-risk at each distinct time and for each subject |
survfunc |
vector of survival estimated in distinct times |
tvals |
copy of argument. |
This function was originally performed by the survrec package, which solved the adjustment problem of the PSH estimator using Fortran routines. With the permission of its author, the algorithm of the packet base was taken, modified, the algorithm of the PSH estimates was reprogrammed and adapted to the needs of the newTestSurvRec package and thus avoid dependence.
Dr. Carlos M. Martinez M., <[email protected]>
Pena, E.A., Strawderman, R. and Hollander M. (2001). Nonparametric Estimation with Recurrent Event Data. J. Amer. Statist. Assoc. 96, 1299-1315.// Pena E., Strawderman R., Hollander, M. (2001). Nonparametric Estimation with Recurrent Event Data. J.A.S.A. 96, 1299-1315.
WC.fit, Survrecu, Plot.Event.Rec, Plot.Surv.Rec, Print.Summary
data(MMC.TestSurvRec) fitPSHa<-PSH.fit(Survrecu(MMC.TestSurvRec$id,MMC.TestSurvRec$time, MMC.TestSurvRec$event)) fitPSHa$surv fitPSHa$time plot(fitPSHa$time,fitPSHa$survfunc,type="s" ,ylim=c(0,1),xlim=c(0,max(fitPSHa$time))) title(main = list("Survival Curve with Recurrent Event Data", cex = 0.8, font = 2.3, col = "dark blue")) mtext("Research Group: AVANCE USE R!", cex = 0.7, font = 2, col = "dark blue", line = 1) mtext("Software made by: Dr. Carlos Martinez", cex = 0.6, font = 2, col = "dark red", line = 0)
data(MMC.TestSurvRec) fitPSHa<-PSH.fit(Survrecu(MMC.TestSurvRec$id,MMC.TestSurvRec$time, MMC.TestSurvRec$event)) fitPSHa$surv fitPSHa$time plot(fitPSHa$time,fitPSHa$survfunc,type="s" ,ylim=c(0,1),xlim=c(0,max(fitPSHa$time))) title(main = list("Survival Curve with Recurrent Event Data", cex = 0.8, font = 2.3, col = "dark blue")) mtext("Research Group: AVANCE USE R!", cex = 0.7, font = 2, col = "dark blue", line = 1) mtext("Software made by: Dr. Carlos Martinez", cex = 0.6, font = 2, col = "dark red", line = 0)
Auxiliary function called from Dif.Surv.Rec function. Given a FitSurvRec object we obtain the quantile from a survival function using PHS o WC estimators.
Qsearch.Fractil(fr, qr = 0.5)
Qsearch.Fractil(fr, qr = 0.5)
fr |
FitSurvRec object |
qr |
quantile. Default is 0.5 |
Returns the time in a selected quantile
Dr. Carlos M Martinez M., <[email protected]>
Martinez C., Ramirez, G., Vasquez M. (2009). Pruebas no parametricas para comparar curvas de supervivencia de dos grupos que experimentan eventos recurrentes. Propuestas. Revista Ingenieria U.C.,Vol 16, 3, 45-55.// Martinez, C. (2009). Generalizacion de algunas pruebas clasicas de comparacion de curvas de supervivencia al caso de eventos de naturaleza recurrente. Tesis doctoral. Universidad Central de Venezuela (UCV). Caracas-Venezuela.
FitSurvRe, Survrecu, is.Survrecu
XL<-data(MMC.TestSurvRec) fit<-FitSurvRec(Survrecu(id,time,event)~1,data=MMC.TestSurvRec) # 35th percentile from the survival function Qsearch.Fractil(fit,q=0.35)
XL<-data(MMC.TestSurvRec) fit<-FitSurvRec(Survrecu(id,time,event)~1,data=MMC.TestSurvRec) # 35th percentile from the survival function Qsearch.Fractil(fit,q=0.35)
Create a survival recurrent object, usually used as a response variable in a model formula
Survrecu(id, time, event)
Survrecu(id, time, event)
id |
Identifier of each subject. This value is the same for all recurrent times of each subject. |
time |
time of recurrence. For each subject the last time are censored. |
event |
The status indicator, 0=no recurrence 1=recurrence. Only these values are accepted. |
An object of class newTestSurvRec is returned. newTestSurRec object is implemented as a matrix of 3 colummns. No method for print. In the case of is.Survrecu, a logical value TRUE if x inherits from class Survrecu, otherwise an FALSE.
Dr. Carlos M. Martinez M., <[email protected]>
Martinez, C. (2009). Generalizacion de algunas pruebas clasicas de comparacion de curvas de supervivencia al caso de eventos de naturaleza recurrente. Tesis doctoral. Universidad Central de Venezuela (UCV). Caracas-Venezuela.
FitSurvRec, is.Survrecu
data(MMC.TestSurvRec) Survrecu(MMC.TestSurvRec$id,MMC.TestSurvRec$time,MMC.TestSurvRec$event)~1
data(MMC.TestSurvRec) Survrecu(MMC.TestSurvRec$id,MMC.TestSurvRec$time,MMC.TestSurvRec$event)~1
This database corresponds to the time of recurrence of tumors in 78 patients with bladder cancer. Patients were randomly assigned to treatments: placebo (47 patients) and pyridoxine (31 patients). Data type data.frame with 222 observations on 8 variables.
data(TBCplapyr)
data(TBCplapyr)
A data frame with 222 observations on the following 9 variables.
j
Observation number
id
ID of each unit. Repeated for each recurrence
Tinicio
Inicial time
time
recurrence o censoring time. For each unit the last time is censored
Tcal
Time if observation for each unit
event
censoring status. 1 = occurrence of the event in the unit and 0 right censored time
strata
Number of strata
trt
a factor with levels or
group
A factor with levels. Group identification
Experiment Byar(1980). The database Byar experiment is used and the time (months) of recurrence of tumors in 116 sick patients with superficial bladder cancer is measured. These patients were randomly allocated to the following treatments: placebo (47 patients), pyridoxine (31 patients) and thiotepa (38 patients).
Andrews D. , Herzberg A., (1985). Data. A collections of problems from many fields for the student and reserarch worker, Springer series in statistics, Springer-Verlag, USA
Martinez C., Ramirez, G., Vasquez M. (2009).Pruebas no parametricas para comparar curvas de supervivencia de dos grupos que experimentan eventos recurrentes. Propuestas. Revista Ingenieria U.C.,Vol 16, 3, 45-55.// Martinez, C. (2009). Generalizacion de algunas pruebas clasicas de comparacion de curvas de supervivencia al caso de eventos de naturaleza recurrente. Tesis doctoral. Universidad Central de Venezuela (UCV). Caracas-Venezuela.// Pena E., Strawderman R., Hollander M. (2001). Nonparametric Estimation with Recurrent Event Data. J.A.S.A. 96, 1299-1315.
XL<-data(TBCplapyr) XL<-data(TBCplapyr) print(XL) Print.Summary(TBCplapyr)
XL<-data(TBCplapyr) XL<-data(TBCplapyr) print(XL) Print.Summary(TBCplapyr)
This database corresponds to the time of recurrence of tumors of 85 patients with bladder cancer. Patients were randomly assigned to treatments: placebo (47 patients) and thiotepa (38 patients). Data type data.frame with 217 observations on 8 variables.
data(TBCplathi)
data(TBCplathi)
A data frame with 217 observations on the following 9 variables.
j
Observation number
id
ID of each unit. Repeated for each recurrence
Tinicio
Inicial time
time
recurrence o censoring time. For each unit the last time is censored
Tcal
Time if observation for each unit
event
censoring status. 1 = ocurrence of the event in the unit and 0 right censored time
strata
Number of strata
trt
a factor with levels or
group
A factor with levels. Group identificator
Experiment Byar (1980). The database Byar experiment is used and the time (months) of recurrence of tumors in 116 sick patients with superficial bladder cancer is measured. These patients were randomly allocated to the following treatments: placebo (47 patients), pyridoxine (31 patients) and thiotepa (38 patients).
Andrews D., Herzberg A., (1985). Data. A collections of problems from many fields for the student and reserarch worker, Springer series in statistics, Springer-Verlag, USA
Martinez C., Ramirez, G., Vasquez M. (2009).Pruebas no parametricas para comparar curvas de supervivencia de dos grupos que experimentan eventos recurrentes. Propuestas. Revista Ingenieria U.C.,Vol 16, 3, 45-55.// Pena E., Strawderman R., Hollander M. (2001). Nonparametric Estimation with Recurrent Event Data. J.A.S.A. 96, 1299-1315.
data(TBCplathi) XL<-data(TBCplathi) print(XL) Print.Summary(TBCplathi) ## maybe str(TBCplathi) ; plot(TBCplathi) ...
data(TBCplathi) XL<-data(TBCplathi) print(XL) Print.Summary(TBCplathi) ## maybe str(TBCplathi) ; plot(TBCplathi) ...
This database corresponds to the time of recurrence of tumors of 69 patients with bladder cancer. Patients were randomly assigned to treatments: pyridoxine (38 patients) and thiotepa (31 patients). Data type data.frame with 171 observations on 8 variables.
data(TBCpyrthi)
data(TBCpyrthi)
A data frame with 171 observations on the following 9 variables.
j
Observation number
id
ID of each unit. Repeated for each recurrence
Tinicio
Inicial time
time
recurrence o censoring time. For each unit the last time is censored
Tcal
Time if observation for each unit
event
censoring status. 1 = ocurrence of the event in the unit and' 0 right censored time
strata
Number of strata
trt
a factor with levels or
group
A factor with levels. Group identificator
Experiment Byar (1980). The database Byar experiment is used and the time (months) of recurrence of tumors in 116 sick patients with superficial bladder cancer is measured. These patients were randomly allocated to the following treatments: placebo (47 patients), pyridoxine (31 patients) and thiotepa (38 patients).
Andrews D., Herzberg A., (1985). Data. A collections of problems from many fields for the student and reserarch worker, Springer series in statistics, Springer-Verlag, USA
Martinez C., Ramirez, G., Vasquez M. (2009).Pruebas no parametricas para comparar curvas de supervivencia de dos grupos que experimentan eventos recurrentes. Propuestas. Revista Ingenieria U.C.,Vol 16, 3, 45-55.//Pena E., Strawderman R., Hollander M. (2001). Nonparametric Estimation with Recurrent Event Data. J.A.S.A. 96, 1299-1315.
data(TBCpyrthi) XL<-data(TBCpyrthi) print(XL) Print.Summary(TBCpyrthi) ## maybe str(TBCpyrthi) ; plot(TBCpyrthi) ...
data(TBCpyrthi) XL<-data(TBCpyrthi) print(XL) Print.Summary(TBCpyrthi) ## maybe str(TBCpyrthi) ; plot(TBCpyrthi) ...
Estimation of survival function for correlated by the product limit estimator PLE method developed by Wang and Chang.
WC.fit(x, tvals)
WC.fit(x, tvals)
x |
a survival recurrent event object |
tvals |
vector of times where the survival function can be estimated. |
Wang-Chang (1999) proposed an estimator of the common marginal survivor function in the case where within-unit inter-occurrence times are correlated. The correlation structure considered by Wang and Chang (1999) is quite general and contains, in particular, both the i.i.d. and multiplicative (hence gamma) frailty model as special cases. This estimator removes the bias noted for the product-limit estimator developed by Pena, Strawderman and Hollander (PSH, 2001) when inter-occurrence times are correlated within units. However, when applied to i.i.d. inter-occurrence times, this estimator is not expected to perform as well as the PSH estimator, especially with regard to efficiency.
Value returned
n |
number of unit or subjects observed. |
m |
vector of number of recurrences in each subject (length n) |
failed |
vector of number of recurrences in each subject (length n*m). Vector ordered (e.g. times of first unit, times of second unit, ..., times of n-unit) |
censored |
vector of times of censorship for each subject (length n) |
numdistinct |
number of distinct failures times. |
distinct |
vector of distinct failures times. |
AtRisk |
matrix of number of persons-at-risk at each distinct time and for each subject |
survfunc |
vector of survival estimated in distinct times |
tvals |
copy of argument. |
This function was originally performed by the survrec package, which solved the adjustment problem of the WC estimator using Fortran routines. With the permission of its author, the algorithm was taken, modified, the algorithm, WC estimator was reprogrammed and adapted to the needs of the newTestSurvRec package and thus avoid dependence.
Dr. Carlos M. Martinez M., <[email protected]>
Wang, M. C. and Chang, S.H. (1999). Nonparametric Estimation of a Recurrent Survival Function. J. Amer. Statist. Assoc. 94, 146-153.// Pena E., Strawderman R., Hollander M. (2001). Nonparametric Estimation with Recurrent Event Data. J.A.S.A. 96, 1299-1315.
PSH.fit, Plot.Event.Rec, Plot.Surv.Rec, Print.Summary
XL<-data(MMC.TestSurvRec) #------------------------------------------------------------------------------------- fitPSHa<-PSH.fit(Survrecu(MMC.TestSurvRec$id,MMC.TestSurvRec$time, MMC.TestSurvRec$event)) fitPSHa$surv fitPSHa$time plot(fitPSHa$time,fitPSHa$survfunc,type="s" ,ylim=c(0,1), xlim=c(0,max(fitPSHa$time))) title(main = list("Survival Curve with Recurrent Event Data", cex = 0.8, font = 2.3, col = "dark blue")) mtext("Research Group: AVANCE USE R!", cex = 0.7, font = 2, col = "dark blue", line = 1) mtext("Software made by: Dr. Carlos Martinez", cex = 0.6, font = 2, col = "dark red", line = 0) fitWCa<-WC.fit(Survrecu(MMC.TestSurvRec$id,MMC.TestSurvRec$time, MMC.TestSurvRec$event)) fitWCa$surv fitWCa$time plot(fitWCa$time,fitWCa$survfunc,type="s" ,ylim=c(0,1), xlim=c(0,max(fitWCa$time)))
XL<-data(MMC.TestSurvRec) #------------------------------------------------------------------------------------- fitPSHa<-PSH.fit(Survrecu(MMC.TestSurvRec$id,MMC.TestSurvRec$time, MMC.TestSurvRec$event)) fitPSHa$surv fitPSHa$time plot(fitPSHa$time,fitPSHa$survfunc,type="s" ,ylim=c(0,1), xlim=c(0,max(fitPSHa$time))) title(main = list("Survival Curve with Recurrent Event Data", cex = 0.8, font = 2.3, col = "dark blue")) mtext("Research Group: AVANCE USE R!", cex = 0.7, font = 2, col = "dark blue", line = 1) mtext("Software made by: Dr. Carlos Martinez", cex = 0.6, font = 2, col = "dark red", line = 0) fitWCa<-WC.fit(Survrecu(MMC.TestSurvRec$id,MMC.TestSurvRec$time, MMC.TestSurvRec$event)) fitWCa$surv fitWCa$time plot(fitWCa$time,fitWCa$survfunc,type="s" ,ylim=c(0,1), xlim=c(0,max(fitWCa$time)))