-1

I am having trouble interpreting the riskRegression() function in the R package riskRegression:

https://cran.r-project.org/web/packages/riskRegression/riskRegression.pdf

I looked over the examples under this function in the package vignette, but none of them actually use this function name. They use different function names such as LRR() or ARR(), so I am rather confused as to what the function actually does.

Shawn Hemelstrand
  • 2,676
  • 4
  • 17
  • 30
user167591
  • 121
  • 5

1 Answers1

1

You can see from the source code below that ARR() and LRR() are just wrappers for riskRegression(link="relative") and riskRegression(link="logistic"), respectively.

library(riskRegression);ARR;LRR
#> riskRegression version 2022.11.21
#> function (formula, data, times, cause, cens.model, cens.formula, 
#>     ...) 
#> {
#>     fit <- riskRegression(formula = formula, data = data, times = times, 
#>         link = "relative", cause = cause, cens.model = cens.model, 
#>         cens.formula = cens.formula, ...)
#>     fit$call <- match.call()
#>     fit
#> }
#> <bytecode: 0x7f99ba1e1738>
#> <environment: namespace:riskRegression>
#> function (formula, data, times, cause, cens.model, cens.formula, 
#>     ...) 
#> {
#>     fit <- riskRegression(formula = formula, data = data, times = times, 
#>         link = "logistic", cause = cause, cens.model = cens.model, 
#>         cens.formula = cens.formula, ...)
#>     fit$call <- match.call()
#>     fit
#> }
#> <bytecode: 0x7f99ba2232e8>
#> <environment: namespace:riskRegression>

Created on 2022-11-26 by the reprex package (v2.0.1)

DaveArmstrong
  • 18,377
  • 2
  • 13
  • 25
  • Thanks for quick answer @DaveArmstrong. I guess it might be worth the package authors making it more clear for new users, especially since LRR and ARR do not even appear in the package vignette as available functions. – user167591 Nov 26 '22 at 14:26
  • 1
    @user167591 I think you're probably right. If you look at the help file for `ARR`, it points to the help file for `riskRegression()`, but the connection could certainly be made clearer. – DaveArmstrong Nov 26 '22 at 15:07