CoxC: Estimate beta

Description Usage Arguments Value Examples

View source: R/RcppExports.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: facility must be integer 1, or a successive vector of integer from 1 to num_facility (number of facilities). String, float, or any other types of facility must be converted to successive integers first. Missingness is not accepted, and the observations must be ordered by time. Ties might affect the correctness.

Usage

1
CoxC(delta, z, facility, num_facility, tol)

Arguments

delta

indicator vector of event

z

design matrix

facility

which facility each patient belongs to

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
set.seed(2019)
testdata = generate_data()
CoxC(testdata$delta, testdata$z, testdata$facility, testdata$num_facility, tol= 1.0e-6)

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