tramnet: Regularized transformation models

View source: R/tramnet.R

tramnetR Documentation

Regularized transformation models

Description

Regularized transformation models

Usage

tramnet(model, ...)

## S3 method for class 'formula'
tramnet(
  model,
  data,
  lambda,
  alpha,
  tram_fun,
  tram_args = NULL,
  constraints = NULL,
  ...
)

## S3 method for class 'tram'
tramnet(model, x, lambda, alpha, constraints = NULL, ...)

Arguments

model

Either a "formula" specifying the regression or an object of class "tram".

...

Additional arguments passed to solve.

data

Object of class "data.frame" containing the variables referred to in the formula model.

lambda

A positive penalty parameter for the whole penalty function.

alpha

A mixing parameter (between zero and one) defining the fraction between lasso and ridge penalties, where alpha = 1 corresponds to a pure lasso and alpha = 0 to a pure ridge penalty.

tram_fun

Character referring to an implementation in package 'tram'. See BoxCoxNET for the implemented models.

tram_args

Additional arguments (besides model and data) passed to tram_fun.

constraints

An optional list containing a matrix of linear inequality contraints on the regression coefficients and a vector specifying the rhs of the inequality.

x

A numeric matrix, where each row corresponds to the same row in the data argument used to fit model.

Details

Partially penalized and constrained transformation models, including Cox models and continuous outcome logistic regression. The methodology is described in the tramnet vignette accompanying this package.

Value

An object of class "tramnet" with coef, logLik, summary, simulate, residuals and plot methods

References

Lucas Kook and Torsten Hothorn, The R Journal (2021) 13:1, pages 581-594. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.32614/RJ-2021-054")}

Examples


if (require("penalized") & require("survival")) {
  ## --- Comparison with penalized
  data("nki70", package = "penalized")
  nki70$resp <- with(nki70, Surv(time, event))
  x <- scale(model.matrix( ~ 0 + DIAPH3 + NUSAP1 + TSPYL5 + C20orf46,
                          data = nki70))
  fit <- penalized(response = resp, penalized = x, lambda1 = 1, lambda2 = 0,
                   standardize = FALSE, data = nki70)
  y <- Coxph(resp ~ 1, data = nki70, order = 10, log_first = TRUE)
  fit2 <- tramnet(y, x, lambda = 1, alpha = 1) ## L1 only
  coef(fit)
  coef(fit2)
}


tramnet documentation built on Nov. 4, 2023, 3 p.m.

Related to tramnet in tramnet...