Description Usage Arguments Value Examples
Plots of survival curves for treatment, control and their difference by 3 methods (KM, IPTW, EL).
1 2 3 |
y |
a numeric vector of observed time |
delta |
a factor vector of indicator for events |
treat |
a factor vector of the treatment indicator |
x |
an optional covariance matrix containing the variables in the model |
psix_moment |
|
t |
a numeric vector of time points for estimation |
method |
the estimation method selected from KM, IPTW or EL |
Nboot |
number of iterations in Bootstrap, default by |
standardize |
a logical object of whether the covariance matrix |
alpha |
alpha level for the conficendence interval, default by |
A plot object with survival curves for treatment, control and their difference with pointwise 95% confidence intervals. The CIs for KM and IPTW are asymptotic estimates, for EL is estimated by the quantiles of Bootstrap
1 2 3 4 5 6 7 8 9 10 11 | library(survival)
y <- as.matrix(gbsg$rfstime/(365.25/12))
treat <- data.matrix(gbsg$hormon)
delta <- as.matrix(gbsg$status)
x <- data.matrix(gbsg[,c("age","meno","size","grade","nodes","pgr","er")])
t <- seq(0,80,2)
plot.st(y=y,delta=delta,treat=treat,x=x,t=t,method="KM",alpha=0.05)
plot.st(y=y,delta=delta,treat=treat,x=x,t=t,method="IPTW",alpha=0.05)
plot.st(y=y,delta=delta,treat=treat,x=x,psix_moment="second",t=t,
method="EL",Nboot=500,standardize=TRUE,alpha=0.05)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.