Description Usage Arguments Value Examples
View source: R/km.est.pi.table.R
Generate table for estimated survival probabilities by IPTW for treatment, control and their difference. Require formattable
package to run.
1 | km.est.pi.table(y,delta,treat,x,t,standardize=FALSE)
|
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 |
t |
a numeric vector of time points for estimation |
standardize |
a logical object of whether the covariance matrix |
A table (formattable
object) containing the estimated S(t) with standard deviation at each time point.
1 2 3 4 5 6 7 8 | 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)
km.est.pi.table(y=y,delta=delta,treat=treat,x=x,t=t,standardize=FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.