Performs risk analysis using general non-linear models. Risk models can be the sum or product of terms. Each term is the product of exponential/linear functions of covariates. Additionally sub-terms can be defined as a sum of exponential, linear threshold, and step functions. Cox Proportional hazards < https://en.wikipedia.org/wiki/Proportional_hazards_model>, Poisson < https://en.wikipedia.org/wiki/Poisson_regression>, and Fine-Gray competing risks < https://www.publichealth.columbia.edu/research/population-health-methods/competing-risk-analysis> regression are supported. This work was sponsored by NASA Grants 80NSSC19M0161 and 80NSSC23M0129 through a subcontract from the National Council on Radiation Protection and Measurements (NCRP). The computing for this project was performed on the Beocat Research Cluster at Kansas State University, which is funded in part by NSF grants CNS-1006860, EPS-1006860, EPS-0919443, ACI-1440548, CHE-1726332, and NIH P20GM113109.

The goal of Colossus is to provide an open-source means of performing
survival analysis on big data with complex risk formulas. Colossus is
designed to perform Cox Proportional Hazard regressions and Poisson
regressions on datasets loaded as data.tables or data.frames. The risk
models allowed are sums or products of linear, log-linear, or several
other radiation dose response formulas highlighted in the vignettes.
Additional plotting capabilities are available.
By default, a fully portable version of the code is compiled, which does
not support OpenMP on every system. Note that Colossus requires OpenMP
support to perform parallel calculations. The environment variable
“R_COLOSSUS_NOT_CRAN” is checked to determine if OpenMP should be
disabled for linux compiling with clang. The number of cores is set to 1
if the environment variable is empty, the operating system is detected
as linux, and the default compiler or R compiler is clang. Colossus
testing checks for the “NOT_CRAN” variable to determine if additional
tests should be run. Setting “NOT_CRAN” to “false” will disable the
longer tests. Currently, OpenMP support is not configured for linux
compiling with clang.
This is a basic example which shows you how to solve a common problem:
library(data.table)
library(parallel)
library(Colossus)
## basic example code with dummy variables
set.seed(3742)
df <- data.table(
"UserID" = 1:100,
"Starting_Age" = c(rep(10, 25), rep(15, 25), rep(20, 25), rep(25, 25)),
"Ending_Age" = c(rep(16, 25), rep(21, 25), rep(26, 25), rep(31, 25)),
"a" = rbinom(100, 3, 0.35),
"b" = rbinom(100, 5, 0.25)
)
## Our event status is dependent on factor 'a'
df$Cancer_Status <- vapply(df$a, function(x) rbinom(1, 1, x / 4), numeric(1))
## We are solving a Cox model
## Intervals defined by starting and ending ages and binary event status
## The hazard ratio is the product of an exponential dependent on a,
## and a linear effect dependent on b
## HR = e^(beta*a) * (1+alpha*b)
model <- Cox(Starting_Age, Ending_Age, Cancer_Status) ~ loglinear(a, 0) + plinear(b, 0) + multiplicative()
## We give a starting parameter guess
a_n <- c(0.1, 0.1)
## List to control the number of iterations and maximum half-steps
control <- list(
"maxiter" = 100, "halfmax" = 5
)
## Run the regression and print result table
e <- CoxRun(model, df, a_n = a_n, control = control)
print(e)
#> |--------------------------------------------------------------------------------|
#> Final Results
#> Covariate Subterm Central Estimate Standard Error 95% Confidence Interval
#> <char> <char> <num> <num> <char>
#> 1: a loglin 0.901 0.2560 (0.399 - 1.4029)
#> 2: b plin -0.155 0.0976 (-0.347 - 0.0358)
#> 2-tail p-value
#> <num>
#> 1: 0.000432
#> 2: 0.111185
#> |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
#>
#> Cox Model Used
#> Entry Age Column was: 'Starting_Age', Survival Age Column was: 'Ending_Age', Outcome Column was: 'Cancer_Status'
#> Risk Groups Used: 4
#> |- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|
#> -2*Log-Likelihood: 182.74, AIC: 186.74
#> Iterations run: 5
#> maximum step size: 1.133e-03, maximum first derivative: 5.375e-03
#> Last iteration improved the log-likelihood by: 1.500e-05
#> Analysis converged
#> All Records Used: 100
#> Run finished in 0.826 seconds
#> |--------------------------------------------------------------------------------|