Learn R Programming

dosresmeta (version 2.0.1)

waldtest: 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 waldtest print(x, digits = 2, ...)

Value

An object of class waldtest, printed with print.waldtest.

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.

Author

Alessio Crippa, alessio.crippa@ki.se

Details

The waldtest and the method print.waldtest are taken from the aod package and simplified for ease of use.

See Also

aod, summary.dosresmeta

Examples

Run this code
## 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)))

Run the code above in your browser using DataLab