This function tests the five hypotheses that Berry, Golder and Milton identify as important when two quantitative variables are interacted in a linear model.

BGMtest(obj, vars, digits = 3, level = 0.05, two.sided = TRUE)

Arguments

obj

An object of class lm.

vars

A vector of two variable names giving the two quantitative variables involved in the interaction. These variables must be involved in one, and only one, interaction.

digits

Number of digits to be printed in the summary.

level

Type I error rate for the tests.

two.sided

Logical indicating whether the tests should be two-sided (if TRUE, the default) or one-sided (if FALSE).

Value

A matrix giving five t-tests.

Examples

data(Duncan, package="carData") mod <- lm(prestige ~ income*education + type, data=Duncan) BGMtest(mod, c("income", "education"))
#> est se t p-value #> P(X|Zmin) 0.815 0.135 6.024 0.000 #> P(X|Zmax) 0.326 0.156 2.087 0.043 #> P(Z|Xmin) 0.603 0.165 3.652 0.001 #> P(Z|Xmax) 0.214 0.126 1.696 0.098 #> P(XZ) -0.005 0.003 -2.081 0.044