Learn R Programming

broom (version 0.3.4)

sexpfit_tidiers: Tidy an expected survival curve

Description

This constructs a summary across time points or overall of an expected survival curve. Note that this contains less information than most survfit objects.

Usage

## S3 method for class 'survexp':
tidy(x, ...)

## S3 method for class 'survexp': glance(x, ...)

Arguments

x
"survexp" object
...
extra arguments (not used)

Value

  • All tidying methods return a data.frame without rownames, whose structure depends on the method chosen.

    tidy returns a one row for each time point, with columns

  • timetime point
  • estimateestimated survival
  • n.risknumber of individuals at risk
  • glance returns a one-row data.frame with the columns:
  • n.maxmaximum number of subjects at risk
  • n.startstarting number of subjects at risk
  • timepointsnumber of timepoints

Examples

Run this code
if (require("survival", quietly = TRUE)) {
    sexpfit <- survexp(futime ~ 1, rmap=list(sex="male", year=accept.dt,
                                             age=(accept.dt-birth.dt)),
                       method='conditional', data=jasa)

    tidy(sexpfit)
    glance(sexpfit)
}

Run the code above in your browser using DataLab