PlotFittedPoly {NormData} | R Documentation |
Explore data
Description
The function PlotFittedPoly fits polynomials of a specified order to the data.
Usage
PlotFittedPoly(Dataset, Test.Score, IV, Center.Value.IV=0,
Order.Polynomial=3, Confidence.Band.Poly=FALSE, Alpha=.01,
EMF = TRUE, Confidence.Band.EMF=TRUE,
xlab, ylab, Color = "red", Black.white=FALSE,
Legend.Location="topright", Legend.text.size=1,
Add.Jitter=0, Seed=123, cex.axis=1, cex.main=1,
cex.lab=1, Loess.Span=0.75, ...)
Arguments
Dataset |
The name of the dataset. |
Test.Score |
The name of the test score. |
IV |
The name of the independent variable. |
Center.Value.IV |
The constant that is subtracted from the independent variable. |
Order.Polynomial |
The order of the polynomials to be fitted. By default, |
Confidence.Band.Poly |
Logical. Should a confidence band around the prediction function of the polynomial model be added to the plot? Default |
Alpha |
The Alpha-level of the confidence band(s) for the polynomial and/or loess models. Default |
EMF |
Logical. Should the EMF be added to the plot? Default |
Confidence.Band.EMF |
Logical. Should a confidence band around the prediction function of the loess model be added to the plot? Default |
xlab |
The label that should be added to the X-axis. Default |
ylab |
The label that should be added to the Y-axis. Default |
Color |
The color to be used for the fitted EMF. Default |
Black.white |
Logical. Should the plot be in black and white (rather than in color)? Default |
Legend.Location |
The location of the legend. Default |
Legend.text.size |
The size of the text of the label for IV2. Default |
Add.Jitter |
The amount of jitter (random noise) that should be added to the test score. Adding a bit of jitter is useful to show the data more clearly, i.e., to avoid overlapping data points. The specified value |
Seed |
The seed that is used when adding jitter. Default |
cex.axis |
The magnification to be used for axis annotation. |
cex.main |
The magnification to be used for the main label. |
cex.lab |
The magnification to be used for X and Y labels. |
Loess.Span |
The parameter |
... |
Extra graphical parameters to be passed to |
Details
For details, see Van der Elst (2023).
Value
No return value, called for side effects.
Author(s)
Wim Van der Elst
References
Van der Elst, W. (2024). Regression-based normative data for psychological assessment: A hands-on approach using R. Springer Nature.
Examples
data(Substitution)
# plot of linear, quadratic and cubic polynomials relating age
# to the LDST test score
PlotFittedPoly(Dataset = Substitution, Test.Score = LDST, IV = Age,
Order.Polynomial = 1, Center.Value.IV = 50)
PlotFittedPoly(Dataset = Substitution, Test.Score = LDST, IV = Age,
Order.Polynomial = 2, Center.Value.IV = 50)
PlotFittedPoly(Dataset = Substitution, Test.Score = LDST, IV = Age,
Order.Polynomial = 3, Center.Value.IV = 50)