RSA | R Documentation |
Added function compare2
to compare two specific models.
plotRSA
: parameter project
can now plot axes ("LOC", "LOIC", "PA1", and "PA2") and the contour lines "contour" on the bottom of the cube. Example: plot(r1, project=c("PA1", "contour"))
Significantly reduced memory footprint of RSA objects, some speed improvements.
Plotting outliers is now more consistent.
The hull is plotted by default (whenever raw data is provided, either in an RSA-fit object, or in the points$data
parameter)
Removed unnecessary warning when plotting an interactive plot.
Changed model abbreviations to be more consistent:
sqdiff
to SQD
SSD
to SSQD
SRSD
to SRSQD
AICc (corrected AIC) is provided in addition in the compare
function - this is better for small sample sizes
An AIC model comparison table can be printed (based on code by Jarrett Byrnes).
Predicted value of stationary point now is reported in summary
New models: onlyx and onlyx2, resp. onlyy and onlyy2, test whether one of both predictors can be dropped altogether. mean model: b1 == b2, i.e., x and y are averaged and taken as a single predictor.
New parameter add
in RSA
function: The user can pass additional lavaan syntax that is added at the end of the generated syntax. For example: RSA(z ~ x*y, data=df, add="abs(a4) > abs(a2); a1==0")
Added the compare2
function which compares two specific models, e.g. compare2(r1, m1="SRR", m2="full")
. Attention: You must take care yourself that the compared models are nested! There is no automatic check, so you could, in principle, compare non-nested models. This is valid for AIC, BIC, CFI, TLI, and R2 indices, but *not* for the chi2-LR test!
plotRSA gained a title
parameter: The main title of the plot.
New generic functions:
fitted
: Return fitted values of a model, e.g.: fitted(r1, model="RR")
residuals
(or resid
): Return residuals of a fitted model, e.g.: resid(r1, model="RR")
. For example, use the qqPlot
function from the car
package to display a qq-plot for regression diagnostics: qqPlot(resid(r2))
RSA(..., cubic=TRUE) now works more reliable. getPar(x, model="cubic") now returns the cubic parameters x^3, y^3, xy^2, and x^2y.
New function summary
. Currently, it is simply an alias to print
cex
parameter now applies to all text output of plotRSA.
If outliers are removed automatically, the RSA
function prints the row numbers of the outliers.
Plotting of outliers (with points=list(out.mark=TRUE)
) is more reliable.
Removed the error using packet 1 'x' and 'units' must have length > 0
bug in 3d plots
Two new models: "onlyx" (x + x^2) and "onlyy" (y + y^2). Also included in compare()
and in compare(... , plot=TRUE)
Arbitrary data points can be plotted in plotRSA
- i.e., you can plot a fit with existing regression weights, and still plot raw data points. See plotRSA(..., points(data=df))
plotRSA(..., points(value="predict"))
now also works in interactive plots (type="i")
The hull in plotRSA
now is much smoother and lies on the surface (before, long connection lines cut through the surface)
print.RSA
now prints the regression coefficients including standardized beta weights, and can print summaries for a submodel: print(r1, model="RR")
. Nicer output with significance stars, formatted p-values, etc.
Refactored plotRSA
and plot.RSA
- much cleaner now
If outliers are removed, this is now printed as a warning (more salient)
added parameter "out.mark" in the points parameter of plotRSA: If set to TRUE, outliers according to Bollen & Jackman (1980) are printed as a red X symbol. This option works regardless of whether the RSA function has set out.rm to TRUE or FALSE:
If out.rm == TRUE
(in RSA
) and out.mark == FALSE
(in plotRSA
), the outlier is removed from the model and *not plotted* in plotRSA
.
If out.rm == TRUE
(in RSA) and out.mark == TRUE
(in plotRSA
), the outlier is removed from the model but plotted and marked in plotRSA
.
If out.rm == FALSE
(in RSA) and out.mark == FALSE
(in plotRSA
), the outlier is not removed from the model and plotted as a normal point in plotRSA
(but not marked as outlier).
If out.rm == FALSE
(in RSA) and out.mark == TRUE
(in plotRSA
), the outlier is not removed from the model, but plotted and marked in plotRSA
.
Example syntax: plotRSA(r1, points=list(show=TRUE, out.mark=TRUE))
replaced bootRSA
and boot.CI
functions by a unified interface: confint()
. This is now standard R behavior. Confidence intervals can be extracted directly from the lavaan model, or bootstrapped. See ?confint
New sanity check: false/implausible convergence of constrained models is detected and a warning is printed.
Changed parameters for points and contours in plotRSA
: now is a list with subelements, e.g.: points=list(show=TRUE, color="red", jitter=.2)
General R 3.0.2 compatibility
Improved non-linear constraints; now false convergences are more uncommon
new parameter in plotRSA
: 'points.value'. If set to "raw", the original response is splotted, if set to "predicted", the predicted value is plotted.
new parameter in plotRSA
: 'jitter'. The amount of jitter of the raw data points (to avoid overplotting). For standardized predictors, values around .02 make sense.
new parameter in plotRSA
: 'contour.highlight'. Provide a vector of values, which indicate contour lines that should be plotted in bold.
new option in getPar
: "r2.adj"
added the null model (= intercept-only model) to RSA
and compare
(the null model can also be plotted and only shows the flat intercept surface)
Added a graphical model comparison: plot(compare(r1))
, or compare(r1, plot=TRUE)
(requires package qgraph
)
new parameter in plotRSA
: 'pal.range'. If set to "box", the color ramp in the 3d and contour plots is scaled to the zlim, if set to "surface" it is scaled to the range of the actual surface. If set to "box", different 3d surface plots can be compared along their color, as long as the zlim is the same for both.
New parameter in plotRSA
: 'maxlines'. Plots the maximum X for a given Y and vice versa.
New models:
added the "shifted rising ridge model" (SRR)
added the "shifted and rotated rising ridge model" (SRRR)
Suppressed another (uncritical) lavaan warning: NaN in sqrt(b3 * b5).
Improved modeltree
plot: non-significant models (with R2.p > .05) are printed in gray
Moved plyr, gridExtra, and RColorBrewer into the Imports section
Added the "rising ridge" model (label = "RR")
Added a movie function movieRSA
: Create rotating and surface changing videos of surface plots! (this function needs ffmpeg to be accessible from the command line. It works on Mac OS, not sure about Windows or Linux!)
The color ramp in the 3d and contour plots now is scaled to the zlim, not to the range of the actual surface (as before). That means: Different surface plots can be compared along their color, as long as the zlim is the same for both.
Moved packages tkrplot and rgl into "Suggests"
Renamed parameter "showSP" to "param" in the plotRSA
function
Renamed parameter "rot" to "rotation" and "label.rot" to "label.rotation" in plotRSA
Changed default rotation of 2d plot (it's now more comparable with the contour plot)
Added parameter cubic
to RSA function. If set to TRUE
, also a cubic surface is fitted, adding four new parameters to the equation: X^3, Y^3, XY^2, and X^2Y
Added parameter project
to plotRSA. If project=TRUE
, all lines which are defines by parameter axes
are projected onto the floor of the cube.
plotRSA
now can plot a convex hull around the data points (set hull=TRUE
); both in type="3d"
and type="contour"
plotRSA
now can plot the CI of the stationary point (set SP.CI=TRUE
); only for type="contour"
All surface parameters now are also calculated for IA and SD models
Added parameter surface
to plot.RSA
. surface = "predict"
(default) plots the predicted surface. This is the known behavior of the function. surface = "smooth"
plots a 2d-smoothed surface of the raw data (employs the Tps
function of the fields
package).
Changed parameter name showBorder
to border
Changed parameter name showContour
to contour