ChB1-mysurvfit: My Survfit

Description Usage Arguments Value Author(s) Examples

Description

Computes numbers at risk, numbers of events at each unique event time within levels of a blocking factor

Usage

1

Arguments

formula

Should be a formula of the form Surv(ti, ev) ~ block where block is the blocking factor. It need not be a factor per se but should have relatively few discrete levels. Sorry, no staggered entry allowed at present

data

a dataframe

subset

you can subset the analysis via logical expression in variables in the dataframe

na.action

pass a method for handling NA values in block such as na.omit, or na.fail

Value

A dataframe of 2*NLEV + 1 columns where NLEV is the number of levels of the factor block.

time

The sorted vector of unique event times from all blocks

nrisk1

The number at risk in block level 1 at each event time

nevent1

The number of events in block level 1 at each event time

...
nriskNLEV

The number at risk in block level NLEV at each event time

neventNLEV

The number of events in block level NLEV at each event time

Author(s)

Grant Izmirlian <izmirlian@nih.gov>

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
  library(PwrGSD)
  data(lung)

  fit.msf <- mysurvfit(Surv(time, I(status==2)) ~ sex, data=lung)

  fit.msf
  ## Not run: 
  plot(fit.msf)
  
## End(Not run)


Search within the PwrGSD package
Search all R packages, documentation and source code

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

Please suggest features or report bugs with the GitHub issue tracker.

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