Type: | Package |
Title: | Nonparametric Estimation and Inference of a Monotone Hazard Ratio Function |
Version: | 0.2.0 |
Description: | 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) <doi:10.1214/23-EJS2173>. |
License: | MIT + file LICENSE |
Imports: | fdrtool, KernSmooth, survival |
Encoding: | UTF-8 |
LazyData: | true |
Depends: | R (≥ 2.10) |
Suggests: | testthat (≥ 3.0.0) |
Config/testthat/edition: | 3 |
RoxygenNote: | 7.3.2 |
URL: | https://github.com/Yujian-Wu/MonotoneHazardRatio |
BugReports: | https://github.com/Yujian-Wu/MonotoneHazardRatio/issues |
NeedsCompilation: | no |
Packaged: | 2024-10-21 14:31:05 UTC; Daniel |
Author: | Yujian Wu [aut, cre] |
Maintainer: | Yujian Wu <yujianwu@umass.edu> |
Repository: | CRAN |
Date/Publication: | 2024-10-22 13:30:17 UTC |
A function used to construct the Nelson-Aalen estimator.
Description
A function used to construct the Nelson-Aalen estimator.
Usage
NA.est(surv.data)
Arguments
surv.data |
A dataframe containing right-censored survival time and censor status. |
Value
est
The Nelson-Aalen object.
A dataframe containing computed chernoff distribution
Description
A dataframe containing computed chernoff distribution
Usage
chernoff_realizations
Format
A data frame with 201 rows and 3 variables:
- xcoor
domain on which chernoff distribution if computed
- DF
Distribution function of the Chernoff distribution
- density
Density of the Chernoff distribution
A function used to remove the repeated numbers for the computation of gcm/lcm.
Description
A function used to remove the repeated numbers for the computation of gcm/lcm.
Usage
gcm.unique(x, y)
Arguments
x |
A vector corresponds to the independent variable. |
y |
A vector corresponds to the dependent variable. |
Value
logcm
GCM of the curve y~x.
Estimate a non-decreasing hazard ratio function, together with a 100(1-\alpha
)% confidence interval
Description
Estimate a non-decreasing hazard ratio function, together with a 100(1-\alpha
)% confidence interval
Usage
monotoneHR(time.grid, S.data, T.data, ci.lvl = 0.05)
Arguments
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 |
Value
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
Examples
# 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 right-censored example data
Description
A dataset containing the right-censored survival time and censor status for two groups of objects
Usage
survData
Format
A data frame with 1217 rows and 3 variables:
- time
right-censored time
- status
object censored or not, with status=0 implies being censored.
- group
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.