Description Usage Arguments Value See Also Examples
calculates the slopes and intercepts for a simple moderation analysis from a lm
1 | moderation.slopes(mod, zsd = 1, mod_name = "Moderator", ...)
|
mod |
the result of a moderation done like this: lm(y~x*z), so that you have one predictor x and one moderator z |
zsd |
the standard deviation of z to calculate the slopes |
... |
Parameter for plot (xlab, ylab, main etc.) |
moderation
1 2 3 4 5 6 7 8 9 10 | data(crime_data)
attach(crime_data)
#crime <- scale(crime)
poverty <- scale(poverty) #poverty-mean(poverty, na.rm=T)
pcths <- scale(pcths) #pcths-mean(pcths, na.rm=T)
zz <- xm*zm
mod <- lm(crime~poverty*pcths)
summary(mod)
moderation.slopes(mod, ylab="crime rate", mod_name = "Highschool pct", xlab="poverty")
detach(crime_data)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.