Test Linear Hypothesis
Test a linear hypothesis for a linear or generalized linear model.
linear.hypothesis(model, ...) lht(...) linear.hypothesis.lm(model, hypothesis.matrix, rhs=0, summary.model=summary(model, corr = FALSE), white.adjust=F, error.SS, error.df) linear.hypothesis.glm(model, hypothesis.matrix, rhs=0, summary.model=summary(model, corr = FALSE))
- model object produced by
- matrix (or vector) giving linear combinations of coefficients by rows.
- right-hand-side vector for hypothesis, with as many entries as
summaryobject for the model; usually specified only when
linear.hypothesisis called from another function that has already computed the summary.
TRUEuse heteroscedasticity-corrected covariance matrix.
- error sum of squares for the hypothesis; if not specified, will be
- error degrees of freedom for the hypothesis; if not specified,
will be taken from
Computes an F-test for the hypothesis in a linear model, or a Wald test in a generalized linear model.
- Returns an
chisq.testobject, with components:
SSH sum of squares for hypothesis (for a linear model). SSE error sum of squares (for a linear model). F F-statistic for the hypothesis (for a linear model.) Df degrees of freedom for F or chisquare. p p-value for the hypothesis. ChiSquare chisquare statistic for the hypothesis (for a generalized linear model).
Fox, J. (1997) Applied Regression, Linear Models, and Related Methods. Sage.
data(Davis) mod<-lm(weight~repwt, data=Davis) linear.hypothesis(mod, diag(2), c(0,1)) ## F-Test ## SS = 245.9738 SSE = 12828.03 F = 1.735312 Df = 2 and 181 p = 0.179266