This function calculates representative values of a vector, like minimum/maximum values or lower, median and upper quartile etc., which can be used for numeric vectors to plot adjusted predictions at these representative values.
Arguments
- x
A numeric vector.
- values
Character vector, naming a pattern for which representative values should be calculcated.
"minmax":
(default) minimum and maximum values (lower and upper bounds) ofx
."meansd"
: uses the mean value ofx
as well as one standard deviation below and above mean value to plot the effect of the moderator on the independent variable."zeromax"
: is similar to the"minmax"
option, however,0
is always used as minimum value forx
. This may be useful for predictors that don't have an empirical zero-value, but absence of moderation should be simulated by using 0 as minimum."fivenum"
: calculates and uses the Tukey's five number summary (minimum, lower-hinge, median, upper-hinge, maximum) ofx
. This is equivalent to"quartiles"
."threenum"
: calculates a three number summary (lower-hinge, median, and upper-hinge) ofx
. This is equivalent to"quartiles2"
."terciles"
: calculates and uses the terciles (lower and upper third) ofx
, including minimum and maximum value."terciles2"
: calculates and uses the terciles (lower and upper third) ofx
, excluding minimum and maximum value.an option to compute a range of percentiles is also possible, using
"percentile"
, followed by the percentage of the range. For example,"percentile95"
will calculate the 95% range ofx
."all"
: uses all values ofx
.