tramnet | R Documentation |
Regularized transformation models
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, ...)
model |
Either a |
... |
Additional arguments passed to |
data |
Object of class |
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 |
tram_fun |
Character referring to an implementation in package
|
tram_args |
Additional arguments (besides |
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
|
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.
An object of class "tramnet"
with coef
, logLik
,
summary
, simulate
, residuals
and plot
methods
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")}
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)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.