waldtest {dosresmeta} | R Documentation |
Wald Test for Model Coefficients
Description
Computes a Wald chi-squared test for 1 or more coefficients, given their variance-covariance matrix.
Usage
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 |
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 |
L |
an optional matrix conformable to |
H0 |
a numeric vector giving the null hypothesis for the test. It must be as long as |
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. |
Details
The waldtest
and the method print.waldtest
are taken from the aod
package and
simplified for ease of use.
Value
An object of class waldtest
, printed with print.waldtest
.
Author(s)
Alessio Crippa, alessio.crippa@ki.se
See Also
aod
, summary.dosresmeta
Examples
## Load data and run the model
data("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 association
waldtest(b = coef(model), Sigma = vcov(model), Terms = 1:nrow(vcov(model)))