This documents the functions needed to test estimability of linear functions of regression coefficients.
1 2 3 4 5 6 7 8 9 10 11
Matrix whose columns span the null space of the model matrix. Such a matrix is returned by
Numeric tolerance for assessing nonestimability. For nonzero x, estimability of β'x is assessed by whether or not ||N'x||^2 < τ ||x'x||^2, where N and τ denote
Additional arguments, currently ignored.
Consider a linear model y = Xβ + E. If X is not of full rank, it is not possible to estimate β uniquely. However, Xβ is uniquely estimable, and so is a'Xβ for any conformable vector a. Since a'X comprises a linear combination of the rows of X, it follows that we can estimate any linear function where the coefficients lie in the row space of X. Equivalently, we can check to ensure that the coefficients are orthogonal to the null space of X.
all.estble is simply a 1 x 1 matrix of
NA. This specifies a trivial non-estimability basis, and using it as
nbasis will cause everything to test as estimable.
When X is not full-rank, the methods for
nonest.basis return a basis for the null space of X. The number of rows is equal to the number of regression coefficients (including any
NAs); and the number of columns is equal to the rank deficiency of the model matrix. The columns are orthonormal. If the model is full-rank, then
matrix method uses X itself, the
qr method uses the QR decomposition of X, and the
lm method recovers the required information from the object.
is.estble returns a logical value (or vector, if
x is a matrix) that is
TRUE if the function is estimable and
FALSE if not.
Russell V. Lenth <[email protected]>
Monahan, John F. (2008) A Primer on Linear Models, CRC Press. (Chapter 3)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
require(estimability) X <- cbind(rep(1,5), 1:5, 5:1, 2:6) ( nb <- nonest.basis(X) ) # Test estimability of some linear functions for this X matrix lfs <- rbind(c(1,4,2,5), c(2,3,9,5), c(1,2,2,1), c(0,1,-1,1)) is.estble(lfs, nb) # Illustration on 'lm' objects: warp.lm1 <- lm(breaks ~ wool * tension, data = warpbreaks, subset = -(26:38), contrasts = list(wool = "contr.treatment", tension = "contr.treatment")) zapsmall(nonest.basis(warp.lm1)) warp.lm2 <- update(warp.lm1, contrasts = list(wool = "contr.sum", tension = "contr.helmert")) zapsmall(nonest.basis(warp.lm2))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.