Git Product home page Git Product logo

dshr's Introduction

DOI

dshr

An R package that implements the methods to derive disease-specific hazard ratios (dsHR) from overall hazard ratios (oHR) described in the publication:

Installation

You can install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("feralaes/dshr")

Example

This is a basic example which shows you how to derive a disease-specific hazard ratio (dsHR) from a disease-specific mortality rate, an overall hazard ratio (oHR) reported in a trial, the initial age of the cohort in the trial, and the length of the trial using an empirical approach with background mortality from US life tables.

library(dshr)
ohr        <- 0.55 # Overall hazard ratio (oHR)
n_age_init <- 50   # Initial age of cohort in trial
trial_time <- 5    # Length of clinial trial in years
mu_Dis     <- 0.05 # Disease-specific mortality rate

dshr_emp <- calc_dshr_from_ohr(ohr = ohr, 
                               mu_Dis = mu_Dis,
                               n_age_init = n_age_init, 
                               trial_time = trial_time, 
                               hazard = "empirical")
dshr_emp
#>      dshr 
#> 0.5038836

To estimate dsHR assuming an anlaytical functional form of background mortality (either exponential, linear or geometric), estimate the mu0 and alpha parameters of the functional form, type them in calc_dshr_from_ohr and substitute empirical with the functional form of interest. For example, using an exponential functional form with background mortality from US life tables, the estimated parameters are

coef_hazard_exp <- est_hazard_params(n_age_init = n_age_init,
                                     trial_time = trial_time,
                                     hazard = "exponential")
coef_hazard_exp
#> $mu0
#>  (Intercept) 
#> 0.0001105985 
#> 
#> $alpha
#>        Age 
#> 0.07362561

and the dshr is

dshr_exp <- calc_dshr_from_ohr(ohr = ohr, 
                               mu_Dis = mu_Dis,
                               n_age_init = n_age_init, 
                               trial_time = trial_time, 
                               mu0 = coef_hazard_exp$mu0,
                               alpha = coef_hazard_exp$alpha,
                               hazard = "exponential")
dshr_exp
#>      dshr 
#> 0.5022318

dshr's People

Contributors

feralaes avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.