This function creates an object of class lm() specific to a moderated multiple regression involving 3 variables.

1 | ```
moderate.lm(x, z, y, data, mc = FALSE)
``` |

`x` |
focal explanatory variable |

`z` |
moderating variable |

`y` |
outcome variable |

`data` |
data.frame containing the variables |

`mc` |
Logical specifying wheter the data are already mean centered |

This model takes x and z and creates the interaction term x*z. If the data are not already mean centered, then x and z are mean centered by subtracting out the means. This is necessary for interpretation and to reduce multicolinearity. The lm() is then computed thusly: Y ~ X + Z + XZ.

An object of class lm(). One can use summary(), coef() or any other function useful to lm(). This model is used by other moderator tools - see below.

This is a very simplistic model. If x or z are categorical, the results will not be accurate. The function can be modified by the user to deal with complications such as covariates, non-continuous variables, etc.

Thomas D. Fletcher tom.fletcher.mp7e@statefarm.com

Aiken, L. S., & West, S. G. (1991). *Multiple regression: Testing and interpreting interactions.* Newbury Park: Sage Publications.

Cohen, J., Cohen, P., West, S. G., & Aiken, L. S. (2003). *Applied multiple regression/correlation analysis for the behavioral sciences, 3rd ed.* Mahwah, NJ: Lawrence Erlbaum Associates.

`sim.slopes`

, `graph.mod`

1 2 3 | ```
data(tra)
lm.mod1 <- moderate.lm(beliefs, values, attitudes, tra)
summary(lm.mod1)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.