Package 'MonotoneHazardRatio'

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

Help Index


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 α\alpha. Default is 0.05.

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 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 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.