test_tilted_slopes: significance of regression slope (the marginal effect) under...

Description Usage Arguments Examples

View source: R/hypothesis.testing.R

Description

significance of regression slope (the marginal effect) under moderation testing restriction: the sig. of beta_x under the moderation of z1, with or without additional interaction terms (z2, z3, etc.)

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
test_tilted_slopes(
  reg.coef,
  v = NULL,
  model,
  x_var.name,
  moderator.name,
  mod.n.sd = 1,
  data,
  t.value.col = 3,
  Pr.col = 4
)

Arguments

reg.coef

a data.frame (or matrix) of regression result or a coeftest object, e.g. summary(lm_model)$coef, coeftest(lm_model, cluster.vcov(lm_model, cbind(data$group1, data$group2)))

v

a customized variance-covariance matrix

model

the model object, such as a "lm" object

x_var.name

main independent variable name in model, a string

moderator.name

moderator name in model, a string

mod.n.sd

specify the strength of the moderating effects, in the unit of s.d.s of the moderator, which can take negative values

data

data used for regression

t.value.col

col number of the t-score in reg.coef

Pr.col

col number of the Prob.(>|t|)) in reg.coef

Examples

1
2
3
4
data(mtcars)
m1 <- lm(mpg ~ vs + carb + hp + wt + wt * hp , data = mtcars)
test_tilted_slopes(reg.coef = summary(m1)$coef, model = m1, 
                   x_var.name = "wt", moderator.name = "hp", data = mtcars)

regrrr documentation built on Aug. 13, 2021, 5:07 p.m.