Description Usage Arguments See Also
This function may help to understand and interpret interaction effects
observed in a linear model (lm
) by means of simple
slopes.
1 2 3 4 5 6 7 | plot_x(data, model, y, x, xq = NULL, lvl = NULL, N = NULL, ylab = y,
xlab = x[1], lwd = 2, lty = 1, col = "black", pch = 20,
alpha = 0.05, col.s = NULL, xlim = range(data[, x[1]]),
ylim = range(data[, y]), seg.len = 0.5, cex.legend = 0.8,
plot.legend = TRUE, at.x = NULL, at.y = NULL, labels.x = TRUE,
labels.y = TRUE, cex.x.axis = 1, cex.y.axis = 1, grid = TRUE,
grid.h = NULL, padj.x = NA, padj.y = NA)
|
data |
A data frame, the same one that was used to fit the model. |
model |
An object of class ( |
y |
Character. The dependent variable in the |
x |
Character vector. The independent variable(s) in the |
xq |
Character. Optional term in your model, namely, the quadratic effect of your first independent variable. |
lvl |
List of numeric vectors. The list must be of length 1 with two predictors and of length 2 with three predictors. Each vector contains the values of the corresponding predictor at which the plot is to be drawn. Defaults to three values, namely M - 1SD, M, and M + 1SD. |
N |
Numeric. A number of data points to plot; possibly smaller than
|
ylab |
Y axis label, same font attributes as |
xlab |
X axis label using font and character expansion
|
lwd |
Numeric. The line width(s) for the line(s) (see
|
lty |
Numeric. The line type(s) for the line(s) (see
|
col |
Character. The color of the points. |
pch |
the plotting symbols appearing in the legend, as
numeric vector or a vector of 1-character strings (see
|
alpha |
Numeric. An alpha transparency value (as an opacity, so 0 means
fully transparent and 1 means opaque; see |
col.s |
Character vector. The color(s) of the slope(s). Must be of
length 1 for one predictor and equal to |
xlim, ylim |
Numeric vectors of length 2, giving the x and y coordinates ranges. |
seg.len |
the length of lines drawn to illustrate |
cex.legend |
Numeric. A value giving the amount by which the legend
should be magnified (see |
plot.legend |
Logical. Should a legend be plotted. |
at.x, at.y |
Numeric. The points at which tick-marks for the x- and the
y-axis, respectively, are to be drawn (see |
labels.x, labels.y |
This can either be a logical value specifying
whether (numerical) annotations are to be made at the tickmarks of the x-
and y-axsi, respetively, or a character or expression vector of labels to
be placed at the tickpoints. If this is not logical, |
cex.x.axis, cex.y.axis |
The magnification to be used for axis annotation
relative to the current setting of cex (see |
grid |
Logical. Should a grid be plotted. |
grid.h |
Numeric. Values of the y-axis at which the horizontal grid lines should be plotted. |
padj.x, padj.y |
Numeric. Adjustment for each tick label perpendicular to
the reading direction. For labels parallel to the axes, padj = 0 means
right or top alignment, and padj = 1 means left or bottom alignment (see
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.