Description Usage Arguments Value See Also Examples
View source: R/vertical_utilities.R
This function creates survival curves for a previously defined vdracox
object. The function also accepts a formula and the original data supplied by the calling party allowing exploration of other potential strata. Both formula
and data
must be NULL or both must be specified.
1 | survfitDistributed(x, formula = NULL, data = NULL)
|
x |
an object of type |
formula |
a formula which defines alternative strata for the survival curve. |
data |
if |
Returns an object of class survfitDistributed
. Objects of this class have methods for the functions print
and plot
. The following components must be included in a legitimate survfitDistributed
object.
n |
the total number of subjects in each curve. |
time |
the time points at which the curve has a step. |
n.risk |
the number of subjects at risk at each time point. |
n.event |
the number of events that occour at each time point. |
n.censor |
the number of subjects who are censored at each time point. |
strata |
the number of points in each strata. |
surv |
the estimate of the survival time at each time step. |
type |
the type of censoring. Currently, always "right". |
1 2 3 4 5 6 7 8 9 10 11 12 13 | sfit = survfitDistributed(vdra_fit_cox_A)
print(sfit)
plot(sfit)
# From Data Partner 1
sfit = survfitDistributed(vdra_fit_cox_A, ~Exposure, data = vdra_data[, c(3:4, 5:7)])
print(sfit)
plot(sfit)
# From Data Partner 2
sfit = survfitDistributed(vdra_fit_cox_B, ~Race + Sex, data = vdra_data[, 8:11])
print(sfit)
plot(sfit, merge = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.