unfolding | R Documentation |
Variant of smacof for rectangular matrices (typically ratings, preferences) that allows for nonmetric transformations. Also known as nonmetric unfolding.
unfolding(delta, ndim = 2, type = c("ratio", "interval", "ordinal", "mspline"),
conditionality = "unconditional", lambda = 0.5, omega = 1,
circle = c("none", "row", "column"), weightmat = NULL, init = NULL,
fixed = c("none", "row", "column"), fixed.coord = NULL,
ties = c("primary", "secondary"), verbose = FALSE, relax = TRUE,
itmax = 10000, eps = 1e-6, spline.degree = 2, spline.intKnots = 2,
parallelize = FALSE)
smacofRect(delta, ndim = 2, type = c("ratio", "interval", "ordinal", "mspline"),
conditionality = "unconditional", lambda = 0.5, omega = 1,
circle = c("none", "row", "column"), weightmat = NULL, init = NULL,
fixed = c("none", "row", "column"), fixed.coord = NULL,
ties = c("primary", "secondary"), verbose = FALSE, relax = TRUE,
itmax = 10000, eps = 1e-6, spline.degree = 2, spline.intKnots = 2,
parallelize = FALSE)
prefscal(delta, ndim = 2, type = c("ratio", "interval", "ordinal", "mspline"),
conditionality = "unconditional", lambda = 0.5, omega = 1,
circle = c("none", "row", "column"), weightmat = NULL, init = NULL,
fixed = c("none", "row", "column"), fixed.coord = NULL,
ties = c("primary", "secondary"), verbose = FALSE, relax = TRUE,
itmax = 10000, eps = 1e-6, spline.degree = 2, spline.intKnots = 2,
parallelize = FALSE)
delta |
Data frame or matrix of preferences, ratings, dissimilarities. |
ndim |
Number of dimensions. |
type |
MDS type: |
conditionality |
A single transformations are applied for the entire matrix |
lambda |
Penalty strength balancing the loss contribution of stress and the penalty (see details). |
omega |
Penalty width determines for what values of the variation coefficient the penalty should become active (see details). |
circle |
If |
weightmat |
Optional matrix with dissimilarity weights. |
init |
Optional list of length two with starting values for the row coordinates (first element) and column coordinates (second element). |
fixed |
Do external unfolding by fixing the |
fixed.coord |
Matrix with fixed coordinates of the appropriate size. |
ties |
Tie specification for |
verbose |
If |
relax |
If |
itmax |
Maximum number of iterations. |
eps |
Convergence criterion. |
spline.degree |
Degree of the spline for an |
spline.intKnots |
Number of interior knots of the spline for a |
parallelize |
Tries to parallelize the computations when |
Unfolding tries to match a rectangular matrix delta
of dissimilarities between row and column objects by Euclidean distances between row and column points. Badness of fit is measured by raw Stress as the sum of squared differences between delta
and the Euclidean distances. Instead of dissimilarities optimal transformations (dhats) can be found. The dhats should be a function of the original delta
restricted to be "ratio"
, "interval"
, "ordinal"
, or "mspline"
. These transformations can be the same for the entire matrix (conditionality = "unconditional"
) of data, or different per row (conditionality = "row"
). To avoid a degenerate solution with all dhats and distances equal to 1, the prefscal penalty is is used.
A penalty is added based on the variation coefficient of the dhats (mean dhat divided by the standard deviation of the dhats). The penalty width (omega
) weights the penalty and determines from what value of the variation coefficient of the dhats the penalty should become active. The penalty strength (lambda
) is needed to ensure that the penalty can be strong enough. Busing et al. (2005) suggest to use \lambda = 0.5
and \omega = 1.0
(for unconditional solutions \omega
can be lowered to a value as low as 0.1).
External unfolding can be done by specifying fixed = "row"
or "column"
and providing the fixed coordinates in fixed.coord
. Then, either the rows or columns are fixed up to a uniform constant.
Creates an object of class smacofR
.
obsdiss |
Observed dissimilarities, corresponds to |
confdist |
Configuration dissimilarities |
dhat |
Matrix with optimal transformation of size |
iord |
List of size 1 for matrix conditional and size |
conf.row |
Matrix of final row configurations |
conf.col |
Matrix of final column configurations |
stress |
Final, normalized stress value |
pstress |
Penalized stress value (the criterion that is minimized) |
spp.row |
Stress per point, rows |
spp.col |
Stress per point, columns |
congvec |
Vector of congruency coefficients |
ndim |
Number of dimensions |
model |
Type of smacof model |
niter |
Number of iterations |
nind |
Number of individuals (rows) |
trans |
Transformation |
conditionality |
Conditionality of the transformation |
nobj |
Number of objects (columns) |
Patrick Groenen, Jan de Leeuw and Patrick Mair
De Leeuw, J. & Mair, P. (2009). Multidimensional scaling using majorization: The R package smacof. Journal of Statistical Software, 31(3), 1-30, \Sexpr[results=rd]{tools:::Rd_expr_doi("10.18637/jss.v031.i03")}
Mair, P., Groenen, P. J. F., De Leeuw, J. (2022). More on multidimensional scaling in R: smacof version 2. Journal of Statistical Software, 102(10), 1-47. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.18637/jss.v102.i10")}
Busing, F. M. T. A., Groenen, P. J. F., & Heiser, W. J. (2005). Avoiding degeneracy in multidimensional unfolding by penalizing on the coefficient of variation. Psychometrika, 70, 71-98.
plot.smacof
, smacofConstraint
, smacofSym
, smacofIndDiff
, smacofSphere
## Ratio unfolding
res <- unfolding(breakfast)
res
## various configuration plots
plot(res)
plot(res, type = "p", pch = 25)
plot(res, type = "p", pch = 25, col.columns = 3,
label.conf.columns = list(label = TRUE, pos = 3, col = 3),
col.rows = 8, label.conf.rows = list(label = TRUE, pos = 3, col = 8))
## Shepard plot
plot(res, "Shepard")
## Stress decomposition chart
plot(res, "stressplot")
## Not run:
## Ordinal unfolding, row-conditional
## Note that ordinal unfolding may need many iterations (several thousands)
res <- unfolding(breakfast, type = "ordinal", conditionality = "row", omega = 0.1, itmax = 3000)
res
plot(res, "Shepard") ## Shepard plot
plot(res)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.