Description Usage Arguments Details Value Author(s) Examples
simple.slopes()
generates simple slopes and tests for the effect of a predictor on an outcome given a linear regression fit. plot.simple.slopes()
generates a plot of the simple regression lines.
1 2 3 4 5 6 7 |
fit |
the output of a call to |
predictor |
optional; a string containing the name of the predictor. By default, it is assumed that the first variable to appear in fit is the predictor; if not, it must be specified here. |
moderator |
optional; a string containing the name of the moderator. By default, it is assumed that the second variable to appear in fit is the sole moderator; if not, it must be specified here. If more than one moderator is present, all of them must be named because the default is to only use the second variable in the fit. |
at.mod.level |
optional; a list of values of each moderator for which simple slopes are to be computed. If |
mod.level.names |
optional; a vector of the same length as |
pred.range |
optional; a vector of length 2 containing the range of the predictor for which the simple regression lines are to be plotted in a call to |
alpha |
the alpha value (significance criterion) of the t-tests for simple slopes. |
sig.region |
optional; a |
s |
a |
colors |
a vector of colors to be used to specify the colors of the lines in the simple slopes plot. See 'Color Specification' at |
... |
other arguments passed to or from other functions. |
simple.slopes()
replicates the simple slopes tool at [quantpsy.org] by allowing users to enter a regression object and specify options for display and computation. Currently it can support up to two moderators. Categorical moderators are supported, but only if exactly one moderator is present. A categorical variable should be entered as a factor variable in the original fit.
It has its own print method, which produces the values and tests of the simple slopes and intercepts for the given values of the moderator(s). plot()
generates a plot of the simple slopes. Note that this plot is a ggplot
object, meaning users can edit it with ggplot2 syntax.
simple.slopes
: An object of class "simple.slopes" with the following entries:
simple.lines
The slopes (w0) and intercepts (w1) and their t- and p-values and confidence intervals for each simple line.
var.names
The names of the outcome, predictor, and moderator(s).
pred.range
The range of the predictor in the original data set.
cz
The values and names of the conditional values of the moderator(s) at which the simple slopes are evaluated.
Noah Greifer
1 2 3 4 5 6 7 8 9 10 11 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.