survDiff {dynsurv} | R Documentation |

## Estimated Difference Between Survival or Cumulative Hazard Functions

### Description

`survDiff`

returns estimated survival function or cumulative function
from posterior estimates. Note that currently, the function is only
applicable to the Bayesian dynamic Cox model with dynamic hazard, where the
control argument is specified to be `control = list(intercept = TRUE)`

in function `bayesCox`

.

### Usage

```
survDiff(object, newdata, type = c("survival", "cumhaz"), level = 0.95, ...)
```

### Arguments

`object` |
An object returned by function |

`newdata` |
An optional data frame used to generate a design matrix. Note that it must lead to a design matrix with two different design. |

`type` |
An optional character value indicating the type of function to
compute. The possible values are "survival" and "cumhaz". The former
means the estimated survival function; the latter represents the
estimated cumulative hazard function for the given |

`level` |
A numerical value between 0 and 1 indicating the level of cradible band. |

`...` |
Other arguments for further usage. |

### Details

The estimated difference between survival curves is a step function representing the difference between the posterior mean survival proportion at the given time grid from the posterior sample. Its credible interval is constructed based on the quantiles of all the pair difference between the survival curves from posterior sample at given credible level.

### Value

A data frame with column: "Low", "Mid", "High", "Time", "Design", and "type", and attribute, "surv" valued as "survDiff".

### References

Wang, W., Chen, M. H., Chiou, S. H., Lai, H. C., Wang, X., Yan, J.,
& Zhang, Z. (2016). Onset of persistent pseudomonas aeruginosa infection in
children with cystic fibrosis with interval censored data.
*BMC Medical Research Methodology*, 16(1), 122.

### See Also

`bayesCox`

, `survCurve`

, and `plotSurv`

.

### Examples

```
## See the examples in bayesCox.
```

*dynsurv*version 0.4-7 Index]