tramnet | R Documentation |
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.
tramnet(model, x, lambda, alpha, constraints = NULL, ...)
model |
an object of class |
x |
a numeric matrix, where each row corresponds to the same row in the
|
lambda |
a positive penalty parameter for the whole penalty function |
alpha |
a mixing parameter (between zero and one) defining the fraction between absolute and quadratic penalty terms |
constraints |
an optional list containing a matrix of linear inequality contraints on the regression coefficients and a vector specifying the rhs of the inequality |
... |
additional parameters to |
An object of class "tramnet"
with coef
, logLik
,
summary
, simulate
, residuals
and plot
methods
Lucas Kook, Balint Tamasi, Sandra Sigfried
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.