| ahreg | R Documentation |
The ahreg function performs a regression analysis for the average hazard (AH).
ahreg(formula, tau, data, link="log", conf.int=0.95,
cens_strata=NULL, cens_covs=NULL)
formula |
A formula object, with the response on the left of a ~ operator, and the terms on the right. The response must be a survival object as returned by the Surv function. For a multi-state model the formula may be a list of formulas. |
tau |
A scalar value to specify a time point for calculating the average hazard. |
data |
A data.frame in which to interpret the variables named in the formula. |
link |
A link function to be used, either "log" (default) or "identity". |
conf.int |
A confidence coefficient for calculating confidence intervals. The default is |
cens_strata |
A variable name for specifying group-specific censoring. Only one of |
cens_covs |
A set of variable names used for modeling censoring time distribution. Only one of |
The function implements the average hazard regression.
an object of class ahreg.
result |
A table containing the coefficient estimates, standard errors, confidence intervals, z-values, and two-sided p-values for each predicotor. |
Hajime Uno, Miki Horiguchi
#' Uno H, Tian L, Horiguchi M, Hattori S, Kehl KL. Regression models for average hazard. Biometrics. 2024; 80(2):ujae037. <doi: 10.1093/biomtc/ujae037>
#================================================================================
# ahreg.sample.data: Sample data from the pbc data in the survival package
#================================================================================
D = ahreg.sample.data()
#-- Independent censoring
a1 = ahreg(Surv(time,status) ~ arm + edema + bili, tau=7, data=D)
print(a1)
#-- Group specific censoring
a2 = ahreg(Surv(time,status) ~ arm + edema + bili, tau=7, data=D, cens_strata="arm")
print(a2)
#-- Covariate dependent censoring via Cox
a3 = ahreg(Surv(time,status) ~ arm + edema + bili, tau=7, data=D, cens_covs=c("arm","edema"))
print(a3)
#-- Covariate dependent censoring via Cox (identity link)
a4 = ahreg(Surv(time,status) ~ arm + edema + bili, tau=7, data=D, cens_covs=c("arm","edema"),
link="identity")
print(a4)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.