Computes a Wald chi-squared test for 1 or more coefficients, given their variance-covariance matrix.
waldtest(Sigma, b, Terms =NULL, L =NULL, H0 =NULL)## S3 method for class 'waldtest'print(x, digits =2,...)
Arguments
Sigma: a var-cov matrix, usually extracted from one of the fitting functions.
b: a vector of coefficients with var-cov matrix Sigma. These coefficients are usually extracted from one of the fitting functions available in R.
Terms: an optional integer vector specifying which coefficients should be jointly tested, using a Wald chi-squared or F test. Its elements correspond to the columns or rows of the var-cov matrix given in Sigma. Default is NULL.
L: an optional matrix conformable to b, such as its product with b gives the linear combinations of the coefficients to be tested. Default is NULL.
H0: a numeric vector giving the null hypothesis for the test. It must be as long as Terms or must have the same number of columns as L. Default to 0 for all the coefficients to be tested.
x: Object of class "waldtest".
digits: number of decimal places for displaying test results. Default to 2.
...: further arguments passed to or from other methods.
Returns
An object of class waldtest, printed with print.waldtest.
Details
The waldtest and the method print.waldtest are taken from the aod package and simplified for ease of use.
Examples
## Load data and run the modeldata("alcohol_cvd")model <- dosresmeta(formula = logrr ~ dose + I(dose^2), type = type, id = id, se = se, cases = cases, n = n, data = alcohol_cvd)## Test for significance of the overall dose-response associationwaldtest(b = coef(model), Sigma = vcov(model), Terms =1:nrow(vcov(model)))