coefficients.stein {ImpShrinkage} | R Documentation |
Coefficients extracted from the model object stein
## S3 method for class 'stein'
coefficients(object, ...)
## S3 method for class 'stein'
coef(object, ...)
object |
An object of class |
... |
Other arguments. |
A vector of coefficients.
coefficients.unrestricted
,
coefficients.restricted
,
coefficients.preliminaryTest
,
coefficients.improvedpreliminaryTest
,
coefficients.positivestein
,
coef.unrestricted
,
coef.restricted
,
coef.preliminaryTest
,
coef.improvedpreliminaryTest
,
coef.positivestein
.
n_obs <- 100
p_vars <- 5
beta <- c(2, 1, 3, 0, 5)
simulated_data <- simdata(n = n_obs, p = p_vars, beta)
X <- simulated_data$X
y <- simulated_data$y
p <- ncol(X)
# H beta = h
H <- matrix(c(1, 1, -1, 0, 0, 1, 0, 1, 0, -1, 0, 0, 0, 1, 0), nr = 3, nc = p, byrow = TRUE)
h <- rep(0, nrow(H))
model <- stReg(X, y, H, h)
coefficients(model)
coef(model)