Movatterモバイル変換


[0]ホーム

URL:


hrcomprisk:Nonparametric Assessment of Differences Between Competing RisksHazards

This package aims to estimate Nonparametric Cumulative-IncidenceBased Estimation of the Ratios of Sub-Hazard Ratios to Cause-SpecificHazard Ratios.

Installation

You can install the latest version ofhrcomprisk in CRANor the development version fromGithub:

# Install hrcomprisk from CRANinstall.packages("hrcomprisk")# Or the development version from GitHub:# install.packages("devtools")devtools::install_github("AntiportaD/hrcomprisk")

Usinga formatted data set to apply thehrcomprsk package

You can use the dataset provided by the authors from theCKiD study, wich has thenecessary variables to run the package.

library(hrcomprisk)data<- hrcomprisk::dat_ckiddim(data)#dimensions#> [1] 626  13names(data)#variable names#>  [1] "b1nb0"        "event"        "male1fe0"     "incomelt30"   "incomegt75"#>  [6] "lps"          "foodassist"   "public"       "matedultcoll" "privatemd"#> [11] "entry"        "exit"         "inckd"

The package will create adata.frame object with thecumulative incidence of each competing risk for each exposure group. Wecan use theCRCumInc fuction.

mydat.CIF<-CRCumInc(df=data,time=exit,event=event,exposed=b1nb0,print.attr=T)#> $names#>  [1] "event"       "exposure"    "time"        "CIoinc_comp" "CIxinc_comp"#>  [6] "CIoinc_1"    "CIxinc_1"    "CIoinc_2"    "CIxinc_2"    "R1"#> [11] "R2"#>#> $class#> [1] "data.frame"
Usinga the output to create Plots of CIFs and the Ratio of Hazard Ratios(Rk)

We can also obtain two different plots using theplotCIFfunction:

  1. The Cumulative Incidence of both events of interest, overall and byexposure level, and
  2. The ratios of Hazard ratios (sub-distribution Hazard Ratio andcause-specific Hazard Ratio) by event.
plots<-plotCIF(cifobj=mydat.CIF,maxtime =20,eoi =1)

Bootstrappingthe data to get 95% Confidence Intervals for the Ratio of Hazard Ratios(Rk)

In order to get confidence intervals to the ratio of Hazard Ratios(Rk), we can use thebootCRCumInc function:

ciCIF<-bootCRCumInc(df=data,exit=exit,event=event,exposure=b1nb0,rep=100,print.attr=T)#> $names#> [1] "R1.lower" "R1.upper" "R2.lower" "R2.upper"#>#> $class#> [1] "data.frame"

Finally, we can use this new data to add the 95% Confidence Intervalsto the previous plot using again theplotCIF function.

plotCIF(cifobj=mydat.CIF,maxtime=20,ci=ciCIF)

The wrapper functionnpcrest

The package also offers a wrapper function (npcrest) todo all these analyses in one step.

npcrest(df=data,exit=exit,event=event,exposure=b1nb0,rep=100,maxtime=20,print.attr=T)#> $names#>  [1] "event"       "exposure"    "time"        "CIoinc_comp" "CIxinc_comp"#>  [6] "CIoinc_1"    "CIxinc_1"    "CIoinc_2"    "CIxinc_2"    "R1"#> [11] "R2"#>#> $class#> [1] "data.frame"#>#> $names#> [1] "R1.lower" "R1.upper" "R2.lower" "R2.upper"#>#> $class#> [1] "data.frame"

References

  1. Ng D, Antiporta DA, Matheson M, Munoz A. Nonparametric assessment ofdifferences between competing risks hazard ratios: application to racialdifferences in pediatric chronic kidney disease progression. ClinicalEpidemiology, 2020.Linkto Journal
  2. Muñoz A, Abraham AG, Matheson M, Wada N. In: Risk Assessment andEvaluation of Predictions. Lee MLT, Gail M, Pfeiffer R, Satten G, Cai T,Gandy A, editor. New York: Springer; 2013. Non-proportionality ofhazards in the competing risks framework; pp. 3–22.GoogleScholar

[8]ページ先頭

©2009-2025 Movatter.jp