| wald.test {sommer} | R Documentation |
Wald Test for Model Coefficients
Description
Computes a Wald \chi^2 test for 1 or more coefficients, given their variance-covariance matrix.
Usage
wald.test(Sigma, b, Terms = NULL, L = NULL, H0 = NULL,
df = NULL, verbose = FALSE)
## S3 method for class 'wald.test'
print(x, digits = 2, ...)
Arguments
Sigma |
A var-cov matrix, usually extracted from one of the fitting functions (e.g., |
b |
A vector of coefficients with var-cov matrix |
Terms |
An optional integer vector specifying which coefficients should be jointly tested, using a Wald
|
L |
An optional matrix conformable to |
H0 |
A numeric vector giving the null hypothesis for the test. It must be as long as |
df |
A numeric vector giving the degrees of freedom to be used in an |
verbose |
A logical scalar controlling the amount of output information. The default is |
x |
Object of class “wald.test” |
digits |
Number of decimal places for displaying test results. Default to 2. |
... |
Additional arguments to |
Details
The key assumption is that the coefficients asymptotically follow a (multivariate) normal distribution with mean =
model coefficients and variance = their var-cov matrix.
One (and only one) of Terms or L must be given. When L is given, it must have the same number of
columns as the length of b, and the same number of rows as the number of linear combinations of coefficients.
When df is given, the \chi^2 Wald statistic is divided by m = the number of
linear combinations of coefficients to be tested (i.e., length(Terms) or nrow(L)). Under the null
hypothesis H0, this new statistic follows an F(m, df) distribution.
Value
An object of class wald.test, printed with print.wald.test.
References
Diggle, P.J., Liang, K.-Y., Zeger, S.L., 1994. Analysis of longitudinal data. Oxford, Clarendon Press, 253 p.
Draper, N.R., Smith, H., 1998. Applied Regression Analysis. New York, John Wiley & Sons, Inc., 706 p.
Examples
data(DT_yatesoats)
DT <- DT_yatesoats
m3 <- mmer(fixed=Y ~ V + N + V:N-1,
random = ~ B + B:MP,
rcov=~units,
data = DT)
wald.test(b = m3$Beta$Estimate, Sigma = m3$VarBeta, Terms = 2)
LL <- matrix(0,nrow=1, ncol=12)
LL[1,2] <- 1
LL[1,3] <- -1
LL
wald.test(b = m3$Beta$Estimate, Sigma = m3$VarBeta, L=LL)