GithubHelp home page GithubHelp logo

coxboost's Introduction

CoxBoost

R-CMD-check

CoxBoost fits Cox proportional hazards models by componentwise likelihood based boosting. It is especially suited for models with a large number of predictors and allows for mandatory covariates with unpenalized parameter estimates.

Installation

You can install the development version of CoxBoost from GitHub with:

# install.packages("pak")
pak::pak("binderh/CoxBoost")

Example

A new feature that currently is only available in the version here, but not on CRAN, is weighted stratified regression for dealing with known subgroups. In particular, the new function resample.CoxBoost (and associated plotting routines stabtrajec and weightfreqmap) allows to explore different weightings of subgroups. The plotting routines help to understand which covariates might be relevant just for one subgroup, or relevant to some degree for more subgroups. The following is a usage example, adapted from the package help page of resample.CoxBoost:

library(CoxBoost)
n <- 400
p <- 1000
set.seed(129)
group <- rbinom(n, 1, 0.5)
x <- matrix(rnorm(n * p, 0, 1), n, p)
beta.vec1 <- c(c(1, 1, 1, 1, 1), rep(0, p - 5))
beta.vec0 <- c(c(0, 0, 0, 0, 0), rep(0, p - 5))
linpred <- ifelse(group == 1, x %*% beta.vec1, x %*% beta.vec0)
set.seed(1234)
real.time <- (-(log(runif(n))) / (1 / 20 * exp(linpred)))
cens.time <- rexp(n, rate = 1 / 20)
obs.status <- ifelse(real.time <= cens.time, 1, 0)
obs.time <- ifelse(real.time <= cens.time, real.time, cens.time)

RIF <- resample.CoxBoost(
  time = obs.time, status = obs.status, x = x, rep = 100, maxstepno = 200, multicore = FALSE,
  mix.list = c(0.001, 0.01, 0.05, 0.1, 0.25, 0.35, 0.5, 0.7, 0.9, 0.99),
  stratum = group, stratnotinfocus = 0, penalty = sum(obs.status) * (1 / 0.02 - 1),
  criterion = "hscore", unpen.index = NULL
)

stabtrajec(RIF)
weightfreqmap(RIF)

coxboost's People

Contributors

binderh avatar jemus42 avatar muschellij2 avatar

Watchers

 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.