test_that("results match coxph in survival", {
set.seed(2019)
testdata = generate_data(F_pre = 1, gamma = 1)
beta1 = CoxC(testdata$delta,testdata$z,testdata$facility,testdata$num_facility,tol= 1.0e-6)
require(survival)
beta2 = coxph(Surv(testdata$time,testdata$delta)~testdata$z+strata(testdata$facility))$coef
expect_equal(as.numeric(beta1), as.vector(beta2))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.