stratified_cox: Estimate beta (Allow Different Types of Facilities)

Description Usage Arguments Value Examples

View source: R/stratified_cox.R

Description

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.

Usage

1
stratified_cox(delta, z, facility_ori, time, num_facility, tol)

Arguments

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

Value

estimated beta

Examples

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)

XuemeiDing/survival19 documentation built on Dec. 1, 2019, 9:52 p.m.