Learn R Programming

islasso (version 1.6.0)

anova.islasso: General Linear Hypotheses for islasso Models

Description

Tests general linear hypotheses and computes confidence intervals for linear combinations of coefficients from a fitted islasso model.

Usage

# S3 method for islasso
anova(object, A, b = NULL, ci, ...)

Value

An object of class "anova.islasso" containing:

Estimate

Linear combination estimates

SE

Standard errors

Wald

Wald statistics

p-value

Associated p-values

Arguments

object

A fitted model object of class "islasso".

A

Hypothesis specification. Either:

  • A numeric matrix or vector with each row specifying a linear combination of coefficients,

  • Or a character vector with symbolic expressions (e.g. "X1 + X2 = 3").

b

Right-hand side vector for the null hypotheses A %*% beta = b. If omitted, defaults to zeros.

ci

Optional 2-column matrix of confidence intervals for coefficients.

...

Currently unused.

Author

Gianluca Sottile gianluca.sottile@unipa.it

Details

The method tests the null hypothesis \(H_0: A \beta = b\), where \(A\) and \(b\) define a linear constraint on model coefficients.

Symbolic expressions support natural syntax: coefficients may be added/subtracted, constants may be multiplied (e.g. "2 * X1 + 3 * X2 = 7"). Equations with omitted = assume zero on the right-hand side. See examples for syntax flexibility.

See Also

islasso, summary.islasso, confint.islasso, predict.islasso, logLik.islasso, residuals.islasso

Examples

Run this code
n <- 100; p <- 100
beta <- c(runif(10, -2, 2), rep(0, p - 10))
sim <- simulXy(n = n, p = p, beta = beta, seed = 1, family = gaussian())
fit <- islasso(y ~ . -1, data = sim$data, family = gaussian())

# Test if first 5 variables sum to -7.5
anova(fit, A = c("X1 + X2 + X3 + X4 + X5 = -7.5"))

# Test multiple hypotheses
anova(fit, A = c("X1 + X2 + X3 + X4 + X5", "X6 + X7 + X8 + X9 + X10"), b = c(-7.5, 8.75))

# Full diagonal comparison to true coefficients
anova(fit, A = diag(p), b = beta)

Run the code above in your browser using DataLab