Description Usage Arguments Value Examples
View source: R/stratified_cox.R
This function estimates beta in a stratified Cox proportional hazard model. You can also set facility to be the same and model an unstratified Cox model with this function. Note, missingness is not allowed, and ties might affect the correctness.
1 | stratified_cox(delta, z, facility_ori, time, num_facility, tol)
|
delta |
indicator vector of event |
z |
design matrix |
facility_ori |
which facility each patient belongs to |
time |
observed time |
num_facility |
number of facilities (strata) |
tol |
tolerance of precision, when highest change in beta is lower than or equal to tol, iteration stops |
estimated beta
1 2 3 4 | set.seed(2019)
testdata = generate_data(F_pre = c("a", "b", "c", "d"), gamma = rep(1, 4), order = FALSE)
stratified_cox(testdata$delta, testdata$z, testdata$facility, testdata$time,
testdata$num_facility, tol= 1.0e-6)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.