RSA | R Documentation |
This version has been uploaded to CRAN.
Removed dependency gridExtra
, added dependency tcltk
Fixed a bug in demoRSA
Added new demo: demoSRRR
, which has surface parameteres as sliders.
Robustness against non-normality: Default estimator now is "MLR", which provides robust standard errors, a robust scaled test statistic, and can handle missing values.
Option missing
in RSA
. If missing values are present, by default missing = "fiml"
is set, and a warning is issued that this is only valid if the data are missing completely at random (MCAR) or missing at random (MAR). Use missing = "listwise"
to exclude missing values.
In the 3d plot, addtionally data points and hull can be projected on the floor. Example: plot(r1, project=c("PA1", "contour", "points", "hull"))
Use pal="flip"
in plotRSA to reverse the default palette (green on bottom, red on top)
Use coefs=TRUE
in plotRSA to print the regression coefficients in the top right corner of a 3d plot.
Added new demo: demoSRR
, which has surface parameteres as sliders.
Internal restructuring to please CRAN; less dependencies (more imports) etc.
Added Travis CI to the Github repo
Catched some border cases in plotRSA (e.g., a flat surface led to problems)
The surface can be suppressed in the 3d plot: suppress.surface=TRUE
. Useful for didactical purposes (first show empty cube, or cube with raw data points, then fade-in the regression surface.)
summary
now also reports the R^2 of the selected model and the intercept.
Changed default for lavaan standard errors and test statistic to "robust"
summary
: The standardized beta weights are now correct.
plotRSA
: The LOC and LOIC now are black in b/w mode
plotRSA
: When attempting to plot an RSA object with plotRSA
(instead of simply plot(r1)
), an informative warning is shown.
New shortcut in plotRSA
: Simply set points=TRUE
(instead of defining the full list).
Fixed a bug in demoRSA
which prevented plotting of RSA-objects.
Moved package aplpack
into Depends
, as plotting the hull now by default is turned on.
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