Usage
sjp.poly(x, poly.term, poly.degree, poly.scale = FALSE, fun = NULL,
axisTitle.x = NULL, axisTitle.y = NULL, showScatterPlot = TRUE,
showLoess = TRUE, showLoessCI = TRUE, showPValues = TRUE,
geom.colors = NULL, geom.size = 0.8, loessLineColor = "#808080",
pointColor = "#404040", pointAlpha = 0.2, printPlot = 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 chara
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 automati
axisTitle.x
A label for the x axis. Use NULL
to automatically detect
variable names that will be used as title (see set_var_labels
) for details). axisTitle.y
A label for the y axis. Use NULL
to automatically detect
variable names that will be used as title (see set_var_labels
) for details). showScatterPlot
If TRUE
(default), a scatter plot of response and predictor values
for each predictor of the fitted model fit
is plotted.
Only applies if type = "lm"
and fitted model has only one predictor,
or if type = "pr
showLoess
If TRUE
, an additional loess-smoothed line is plotted.
showLoessCI
If TRUE
, a confidence region for the loess-smoothed line
will be plotted.
showPValues
logical, if TRUE
(default), p-values for polynomial terms are
printed to the console.
geom.colors
User defined color palette for geoms. Must either be vector with two color values
or a specific color palette code. See 'Note' in sjp.grpfrq
. geom.size
size resp. width of plotted lines.
loessLineColor
color of the loess-smoothed line. Only applies, if showLoess = TRUE
.
pointColor
color of the scatter plot's point. Only applies, if showScatterPlot = TRUE
.
pointAlpha
The alpha values of the scatter plot's point-geoms. Default is 0.2.
printPlot
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.