# Plot Method for coxph Objects

### Description

Plots the predicted survival function from a `coxph`

object, setting covariates to particular values.

### Usage

1 2 3 |

### Arguments

`x` |
a |

`newdata` |
a data frame containing (combinations of) values to which predictors are set; optional. |

`typical` |
function to use to compute "typical" values of numeric predictors. |

`byfactors` |
if |

`col` |
colors for lines. |

`lty` |
line-types for lines; if missing, defaults to 1 to number required. |

`conf.level` |
level for confidence intervals; note: whether or not confidence intervals are
plotted is determined by |

`...` |
arguments passed to |

### Details

If `newdata`

is missing then all combinations of levels of factor-predictors (or strata),
if present, are combined with "typical" values of numeric predictors.

### Value

Invisibly returns the `summary`

resulting from applying `survfit.coxph`

to the `coxph`

object.

### Author(s)

John Fox jfox@mcmaster.ca.

### References

John Fox, Marilia Sa Carvalho (2012).
The RcmdrPlugin.survival Package: Extending the R Commander Interface to Survival Analysis.
*Journal of Statistical Software*, 49(7), 1-32.

### See Also

`coxph`

, `survfit.coxph`

,
`plot.survfit`

.

### Examples

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ```
require(survival)
cancer$sex <- factor(ifelse(cancer$sex == 1, "male", "female"))
mod.1 <- coxph(Surv(time, status) ~ age + wt.loss, data=cancer)
plot(mod.1)
plot(mod.1, typical=function(x) quantile(x, c(.25, .75)))
mod.2 <- coxph(Surv(time, status) ~ age + wt.loss + sex, data=cancer)
plot(mod.2)
mod.3 <- coxph(Surv(time, status) ~ (age + wt.loss)*sex, data=cancer)
plot(mod.3)
mod.4 <- coxph(Surv(time, status) ~ age + wt.loss + strata(sex), data=cancer)
plot(mod.4)
mods.1 <- survreg(Surv(time, status) ~ age + wt.loss, data=cancer)
``` |

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker. Vote for new features on Trello.