Estimation of survival function for correlated or i.i.d. recurrence time data by means of the product limit estimator (PLE) method developed by Wang and Chang. The resulting object of class "survfitr" is plotted by ‘plot.survfitr’, before it is returned.

1 | ```
wc.fit(x,tvals)
``` |

`x` |
a survival recurrent event object. |

`tvals` |
vector of times where the survival function can be estimated. |

Wang and Chang (1999) proposed an estimator of the common marginal survivor function in the case where within-unit interrocurence 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 produc-limit estimator developed by Pea, Strawderman and Hollander (PSH, 2001) when interrocurence times are correlated within units. However, when applied to i.i.d. interocurrence times, this estimator is not expected to perform as well as the PSH estimator, especially with regard to efficiency.

`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. |

`PSHpleAttvals` |
vector of survival estimated in tvals times. |

The mantainer wishes to thank Professors Chiung-Yu Huang and Shu-Hui Chang for their help for providing us with the Fortran code which computes standard errors of Wang and Chang's estimator.

Wang, M.-C. and Chang, S.-H. (1999). Nonparametric Estimation of a Recurrent Survival Function. *J. Amer. Statist. Assoc* **94**, 146-153.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.