Usage
sjp.poly(x, poly.term, poly.degree, poly.scale = FALSE, fun = NULL, axis.title = NULL, scatter.plot = TRUE, show.loess = TRUE, show.loess.ci = TRUE, show.p = TRUE, geom.colors = NULL, geom.size = 0.8, loess.color = "#808080", point.color = "#404040", point.alpha = 0.2, prnt.plot = TRUE)
Arguments
x
a vector, representing the response variable of a linear (mixed) model; or
a linear (mixed) model as returned by lm
or lmer
. poly.term
if x
is a vector, poly.term
should also be a vector, representing
the polynomial term (independent variabl) in the model; if x
is a
fitted model, poly.term
should be the polynomial term's name as character string.
See 'Examples'.
poly.degree
numeric, or numeric vector, indicating the degree of the polynomial.
If poly.degree
is a numeric vector, multiple polynomial curves for
each degree are plotted. See 'Examples'.
poly.scale
logical, if TRUE
, poly.term
will be scaled before
linear regression is computed. Default is FALSE
. Scaling the polynomial
term may have an impact on the resulting p-values.
fun
linear function when modelling polynomial terms. Use fun = "lm"
for linear models, or fun = "glm"
for generalized linear models.
When x
is not a vector, but a fitted model object, the function
is detected automatically. If x
is a vector, fun
defaults
to "lm"
.
axis.title
character vector of length one or two (depending on
the plot function and type), used as title(s) for the x and y axis.
If not specified, a default labelling is chosen.
scatter.plot
logical, if TRUE
(default), a scatter plot of
response and predictor values for each predictor of the model
is plotted. Only applies for slope-type plots.
show.loess
If TRUE
, an additional loess-smoothed line is plotted.
show.loess.ci
If TRUE
, a confidence region for the loess-smoothed line
will be plotted.
show.p
logical, if TRUE
(default), p-values for polynomial terms are
printed to the console.
geom.colors
user defined color palette for geoms. If group.estimates
is not specified, must either be vector with two color values or a specific
color palette code (see 'Details' in sjp.grpfrq
). Else, if
group.estimates
is specified, geom.colors
must be a vector
of same length as groups. See 'Examples'. geom.size
size resp. width of the geoms (bar width, line thickness or point size,
depending on plot type and function). Note that bar and bin widths mostly
need smaller values than dot sizes.
loess.color
color of the loess-smoothed line. Only applies, if show.loess = TRUE
.
point.color
color of the scatter plot's point. Only applies, if scatter.plot = TRUE
.
point.alpha
alpha value of point-geoms in the scatter plots.
prnt.plot
logical, if TRUE
(default), plots the results as graph. Use FALSE
if you don't
want to plot any graphs. In either case, the ggplot-object will be returned as value.