mysurvfit {PwrGSD} | R Documentation |
My Survfit
Description
Computes numbers at risk, numbers of events at each unique event time within levels of a blocking factor
Usage
mysurvfit(formula = formula(data), data = parent.frame(), subset, na.action = na.fail)
Arguments
formula |
Should be a formula of the form |
data |
a dataframe |
subset |
you can subset the analysis via logical expression in variables in the dataframe |
na.action |
pass a method for handling |
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
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)