morals | R Documentation |
Fits multiple regression within the Gifi framework.
morals(x, y, xknots = knotsGifi(x, "Q"), yknots = knotsGifi(y, "Q"), xdegrees = 2, ydegrees = 2, xordinal = TRUE, yordinal = TRUE, xties = "s", yties = "s", xmissing = "m", ymissing = "m", xactive = TRUE, xcopies = 1, itmax = 1000, eps = 1e-6, verbose = FALSE)
x |
Vector or data frame with predictor variables (all numeric) |
y |
Vector with response variable |
xknots |
Knots specification for predictors (see |
yknots |
Knots specification for response (see |
xdegrees |
Degree specification for predictors |
ydegrees |
Degree specification for response |
xordinal |
Whether predictors should be considered as ordinal or not. Alternatively, one can specify a boolean vector of length m denoting which variables should be ordinally restricted or not |
yordinal |
Whether response should be considered as ordinal or not |
xties |
How predictor ties should be handled: primary ( |
yties |
How response ties should be handled: primary ( |
xmissing |
How missing predictor values should be handled: multiple ( |
ymissing |
How missing response values should be handled: multiple ( |
xactive |
Which predictors should be active or inactive |
xcopies |
Number of copies for each predictor |
itmax |
Maximum number of iterations |
eps |
Convergence criterion |
verbose |
Iteration printout |
Fits MORALS as described in De Leeuw et al. (2017).
rhat |
Induced correlation matrix |
objectscores |
Object scores (rows) |
xhat |
Optimally transformed predictors |
yhat |
Optimally transformed response |
ypred |
Predicted (fitted) values |
yres |
Residuals |
smc |
Squared multiple correlation |
ntel |
Number of iterations |
f |
Loss function value |
Gifi, A. (1990). Nonlinear Multivariate Analysis. New York: Wiley.
De Leeuw, J., Mair, P., Groenen, P. J. F. (2017). Multivariate Analysis with Optimal Scaling.
homals
, princals
, plot.morals
x <- scale(as.matrix(seq(0, pi, length = 20)), scale = FALSE) y <- scale(as.matrix(sin(x)), scale = FALSE) fitxy <- morals(x, y, xknots = knotsGifi(x, "E"), xdegrees = 2) plot(fitxy, main = c("x", "y")) plot(fitxy, plot.type = "resplot") plot(fitxy$xhat, fitxy$yhat) lines(fitxy$xhat, fitxy$ypred) plot(x, fitxy$yhat) lines(x, fitxy$ypred)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.