lincom: Linear combination of regression coefficients

View source: R/lincom.R

lincomR Documentation

Linear combination of regression coefficients

Description

This function calculates the point estimate and standard error for a linear combination of regression coefficients (similar to Stata's "lincom" function). At this stage the combination must be specified as a numeric vector (or matrix) of weights – future updates will extend this to allow more flexible methods of specifying coefficient combinations (similar to car's linearHypothesis function).

Usage

lincom(model, weights, vcov. = NULL)

Arguments

model

A regression model with coef and vcov methods.

weights

A numeric vector of coefficient weights to construct the combination, or a matrix in which each row represents one such combination. Each element specifies the weight applied to the corresponding element of attr(terms(model), "term.labels").

vcov.

(Optional) Either a function for estimating the covariance matrix of the regression coefficients, or the covariance matrix itself. If not specified, the default vcov method is used.


uo-cmor/regtools documentation built on Oct. 13, 2024, 10:35 p.m.