lincom: Linear combinations of fitted-model coefficients

View source: R/postestimation.R

lincomR Documentation

Linear combinations of fitted-model coefficients

Description

Calculates estimates, standard errors, confidence intervals and Wald tests for linear combinations of coefficients from the active or supplied model.

Usage

lincom(...,
  model = NULL,
  rhs = 0,
  exp = FALSE,
  level = 0.95,
  digits = 3,
  p_digits = 3,
  show = TRUE,
  console = FALSE)

Arguments

...

One or more linear-combination expressions using coefficient names, or character expressions.

model

Optional fitted model/R4VN result; active model is used when omitted.

rhs

Null value for the linear combination.

exp

Exponentiate estimate and confidence interval.

level

Confidence level.

digits, p_digits

Formatting digits.

show, console

R4VN display controls.

Value

An R4VN result object, invisibly.

See Also

margins, predict

Examples

d <- data.frame(
  y = c(50, 54, 57, 61, 65, 68, 72, 76),
  age = c(20, 25, 30, 35, 40, 45, 50, 55),
  bmi = c(20, 22, 21, 24, 25, 27, 26, 29)
)
regress(y, c.age, c.bmi, data = d, show = FALSE)
lincom(age + 2 * bmi, show = FALSE)
lincom("age - bmi", show = FALSE)

R4VN documentation built on Sept. 30, 2026, 5:13 p.m.