Learn R Programming

tramnet (version 0.0-8)

coef.tramnet_Lm: coef method for class "tramnet_Lm"

Description

coef method for class "tramnet_Lm"

Usage

# S3 method for tramnet_Lm
coef(object, with_baseline = FALSE, tol = 1e-06,
  as.lm = FALSE, ...)

Value

Numeric vector containing the linear model shift parameter estimates

Arguments

object

object of class "tramnet_Lm"

with_baseline

If TRUE, also prints coefficients for the baseline transformation

tol

tolerance when an estimate should be considered 0 and not returned (default: 1e-6)

as.lm

If TRUE parameters are rescaled to the usual parametrization of lm

...

Additional arguments to coef

Author

Torsten Hothorn, Lucas Kook

Examples

Run this code
# \donttest{
data(cars)
m0 <- Lm(dist ~ 1, data = cars)
x <- as.matrix(cars[, "speed", drop = FALSE])
mt <- tramnet(m0, x = x, alpha = 0, lambda = 0, check_dcp = FALSE)
coef(mt)
coef(mt, with_baseline = TRUE)
coef(mt, as.lm = TRUE)
coef(lm(dist ~ speed, data = cars))
# }

Run the code above in your browser using DataLab