Title: | Nonparametric Estimation and Inference of a Monotone Hazard Ratio Function |
---|---|
Description: | A tool for nonparametric estimation and inference of a non-decreasing monotone hazard ratio from a right censored survival dataset. The estimator is based on a generalized Grenander typed estimator, and the inference procedure relies on direct plugin estimation of a first order derivative. More details please refer to the paper "Nonparametric inference under a monotone hazard ratio order" by Y. Wu and T. Westling (2023). |
Authors: | Yujian Wu |
Maintainer: | Yujian Wu <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.2.0 |
Built: | 2025-01-21 05:10:43 UTC |
Source: | https://github.com/yujian-wu/monotonehazardratio |
A dataframe containing computed chernoff distribution
chernoff_realizations
chernoff_realizations
A data frame with 201 rows and 3 variables:
domain on which chernoff distribution if computed
Distribution function of the Chernoff distribution
Density of the Chernoff distribution
A function used to remove the repeated numbers for the computation of gcm/lcm.
gcm.unique(x, y)
gcm.unique(x, y)
x |
A vector corresponds to the independent variable. |
y |
A vector corresponds to the dependent variable. |
logcm
GCM of the curve y~x.
)% confidence intervalEstimate a non-decreasing hazard ratio function, together with a 100(1-)% confidence interval
monotoneHR(time.grid, S.data, T.data, ci.lvl = 0.05)
monotoneHR(time.grid, S.data, T.data, ci.lvl = 0.05)
time.grid |
A vector on which the hazard ratio function to be evaluated |
S.data |
A dataframe containing observed survival time and censoring, it corresponds to the hazard function on the numerator |
T.data |
A dataframe containing observed survival time and censoring, it corresponds to the hazard function on the demoninator |
ci.lvl |
A number that specify the confidence level |
hr
The estimated hazard ratio
tau
The estimated scaled parameter of the limiting Chernoff distribution
ci.upper
and ci.lower
are the upper bound and lower bound of the estimated confidence interval
# load the example data data(survData) # load the computed Chernoff distribution data("chernoff_realizations") # split the data into two groups S and T, make sure that the column of survival time # is named as "time", and the column of censoring named as "status" (0 as being censored) s.data <- survData[survData$group == 'S',] t.data <- survData[survData$group == 'T',] # define the evaluation grid on which the hazard ratio function is to be computed t.grid <- seq(0, 10, 1) # estimation and inference of the non-decreasing hazard ratio (defined as #\eqn{\lambda_S}/\eqn{\lambda_T}, where \eqn{\lambda} is the hazard function) function theta <- monotoneHR(t.grid, s.data, t.data)
# load the example data data(survData) # load the computed Chernoff distribution data("chernoff_realizations") # split the data into two groups S and T, make sure that the column of survival time # is named as "time", and the column of censoring named as "status" (0 as being censored) s.data <- survData[survData$group == 'S',] t.data <- survData[survData$group == 'T',] # define the evaluation grid on which the hazard ratio function is to be computed t.grid <- seq(0, 10, 1) # estimation and inference of the non-decreasing hazard ratio (defined as #\eqn{\lambda_S}/\eqn{\lambda_T}, where \eqn{\lambda} is the hazard function) function theta <- monotoneHR(t.grid, s.data, t.data)
A function used to construct the Nelson-Aalen estimator.
NA.est(surv.data)
NA.est(surv.data)
surv.data |
A dataframe containing right-censored survival time and censor status. |
est
The Nelson-Aalen object.
A dataset containing the right-censored survival time and censor status for two groups of objects
survData
survData
A data frame with 1217 rows and 3 variables:
right-censored time
object censored or not, with status=0 implies being censored.
Treatment group of the objects. By default, for a non-decreasing hazard ratio, S is the group on the numerator and T is the group on the denominator.