library(car)
m3 <- lm(statusquo ~ income * sex, data = Chile)
m3ps <-plotSlopes(m3, modx = "sex", plotx = "income")
testSlopes(m3ps)
m4 <- lm(statusquo ~ region * income, data= Chile)
m4ps <- plotSlopes(m4, modx = "region", plotx = "income", plotPoints = FALSE)
testSlopes(m4ps)
m5 <- lm(statusquo ~ region * income + sex + age, data= Chile)
m5ps <- plotSlopes(m5, modx = "region", plotx = "income")
testSlopes(m5ps)
m6 <- lm(statusquo ~ income * age + education + sex + age, data=Chile)
m6ps <- plotSlopes(m6, modx = "income", plotx = "age")
testSlopes(m6ps)
## Finally, if model has no relevant interactions, testSlopes does nothing.
m9 <- lm(statusquo ~ age + income * education + sex + age, data=Chile)
m9ps <- plotSlopes(m9, modx = "education", plotx = "age", plotPoints = FALSE)
testSlopes(m9ps)
Run the code above in your browser using DataLab