optSmacofSym_mMDS: Selecting the optimal multidimensional scaling procedure -...

View source: R/optSmacofSym.r

optSmacofSym_mMDSR Documentation

Selecting the optimal multidimensional scaling procedure - metric MDS

Description

Selecting the optimal multidimensional scaling procedure by varying all combinations of normalization methods, distance measures, and metric MDS models

Usage

optSmacofSym_mMDS(x,normalizations=NULL,distances=NULL,
mdsmodels=NULL,weights=NULL,spline.degrees=c(2),
outputCsv="",outputCsv2="",outDec=",",
stressDigits=6,HHIDigits=2,...)

Arguments

x

matrix or dataset

normalizations

optional, vector of normalization methods that should be used in procedure

distances

optional, vector of distance measures (manhattan, Euclidean, Chebyshew, squared Euclidean, GDM1) that should be used in procedure

mdsmodels

optional, vector of multidimensional models (ratio, interval, mspline) that should be used in procedure

spline.degrees

optional, vector (e.g. 2:4) of spline.degree parameter values that should be used in procedure for mspline model

weights

optional, variable weights used in distance calculation. Each weight takes value from interval [0; 1] and sum of weights equals one

outputCsv

optional, name of csv file with results

outputCsv2

optional, name of csv (comma as decimal point sign) file with results

outDec

decimal sign used in returned table

stressDigits

Number of decimal digits for displaying Stress 1 value

HHIDigits

Number of decimal digits for displaying HHI spp value

...

arguments passed to smacofSym, like ndim, itmax, eps and others

Details

Parameter normalizations may be the subset of the following values:

"n1","n2","n3","n3a","n4","n5","n5a","n6","n6a",

"n7","n8","n9","n9a","n10","n11","n12","n12a","n13"

(e.g. normalizations=c("n1","n2","n3","n5","n5a",

"n8","n9","n9a","n11","n12a"))

if normalizations is set to "n0" no normalization is applied

Parameter distances may be the subset of the following values:

"euclidean","manhattan","maximum","seuclidean","GDM1"

(e.g. distances=c("euclidean","manhattan"))

Parameter mdsmodels may be the subset of the following values (metric MDS):

"ratio","interval","mspline" (e.g. c("ratio","interval"))

Value

Data frame ordered by increasing value of Stress-1 fit measure with columns:

Normalization method

normalization method used for p-th multidimensional scaling procedure

MDS model

MDS model used for p-th multidimensional scaling procedure

Spline degree

Additional spline.degree value if mspline model is used for simulation, for other models there is no value in this cell

Distance measure

distance measure used for p-th multidimensional scaling procedure

STRESS 1

value of Kruskal Stress-1 fit measure for p-th multidimensional scaling procedure

HHI spp

Hirschman-Herfindahl HHI index calculated based on stress per point for p-th multidimensional scaling procedure

Author(s)

Marek Walesiak marek.walesiak@ue.wroc.pl

Department of Econometrics and Computer Science, Wroclaw University of Economics and Business, Poland

Andrzej Dudek andrzej.dudek@ue.wroc.pl

Department of Financial Investments and Risk Management, Wroclaw University of Economics and Business, Poland

References

Borg, I., Groenen, P.J.F. (2005), Modern Multidimensional Scaling. Theory and Applications, 2nd Edition, Springer Science+Business Media, New York. ISBN: 978-0387-25150-9. Available at: https://link.springer.com/book/10.1007/0-387-28981-X.

Borg, I., Groenen, P.J.F., Mair, P. (2013), Applied Multidimensional Scaling, Springer, Heidelberg, New York, Dordrecht, London. Available at: \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/978-3-642-31848-1")}.

De Leeuw, J., Mair, P. (2015), Shepard Diagram, Wiley StatsRef: Statistics Reference Online, John Wiley & Sons Ltd.

Dudek, A., Walesiak, M. (2020), The Choice of Variable Normalization Method in Cluster Analysis, pp. 325-340, [In:] K. S. Soliman (Ed.), Education Excellence and Innovation Management: A 2025 Vision to Sustain Economic Development during Global Challenges, Proceedings of the 35th International Business Information Management Association Conference (IBIMA), 1-2 April 2020, Seville, Spain. ISBN: 978-0-9998551-4-1.

Herfindahl, O.C. (1950), Concentration in the Steel Industry, Doctoral thesis, Columbia University.

Hirschman, A.O. (1964), The Paternity of an Index, The American Economic Review, Vol. 54, 761-762.

Walesiak, M. (2014), Przegląd formuł normalizacji wartości zmiennych oraz ich własności w statystycznej analizie wielowymiarowej [Data Normalization in Multivariate Data Analysis. An Overview and Properties], Przegląd Statystyczny, tom 61, z. 4, 363-372. Available at: \Sexpr[results=rd]{tools:::Rd_expr_doi("10.5604/01.3001.0016.1740")}.

Walesiak, M. (2016a), Wybór grup metod normalizacji wartości zmiennych w skalowaniu wielowymiarowym [The Choice of Groups of Variable Normalization Methods in Multidimensional Scaling], Przegląd Statystyczny, tom 63, z. 1, 7-18. Available at: \Sexpr[results=rd]{tools:::Rd_expr_doi("10.5604/01.3001.0014.1145")}.

Walesiak, M. (2016b), Visualization of Linear Ordering Results for Metric Data with the Application of Multidimensional Scaling, Ekonometria, 2(52), 9-21. Available at: \Sexpr[results=rd]{tools:::Rd_expr_doi("10.15611/ekt.2016.2.01")}.

Walesiak, M., Dudek, A. (2017), Selecting the Optimal Multidimensional Scaling Procedure for Metric Data with R Environment, STATISTICS IN TRANSITION new series, September, Vol. 18, No. 3, pp. 521-540. Available at: \Sexpr[results=rd]{tools:::Rd_expr_doi("10.59170/stattrans-2017-027")}.

Walesiak, M., Dudek, A. (2020), Searching for an Optimal MDS Procedure for Metric and Interval-Valued Data using mdsOpt R package, pp. 307-324, [In:] K. S. Soliman (Ed.), Education Excellence and Innovation Management: A 2025 Vision to Sustain Economic Development during Global Challenges, Proceedings of the 35th International Business Information Management Association Conference (IBIMA), 1-2 April 2020, Seville, Spain. ISBN: 978-0-9998551-4-1.

Walesiak, M., Dehnel, G., Dudek, A. (2025), Visualisation of linear ordering results using multidimensional scaling – problems and an overview of studies, Argumenta Oeconomica, No 1 (54), 187-203. Available at: \Sexpr[results=rd]{tools:::Rd_expr_doi("10.15611/aoe.2025.1.12")}.

Walesiak, M., Dehnel, G. (2026), Assessment of the implementation of SDG 4 goal by EU countries in the light of the 2030 Agenda using a hybrid approach in linear ordering, PLoS ONE 21(6): e0333545. Available at: \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1371/journal.pone.0333545")}.

See Also

data.Normalization, dist.GDM, dist, smacofSym

Examples

  
  library(mdsOpt)
  library(ggplot2)
  library(ggrepel)
  metnor<-c("n1","n2","n3","n5","n5a","n8","n9","n9a","n11","n12a")
  metscale<-c("ratio","interval","mspline")
  metdist<-c("euclidean","manhattan","seuclidean","maximum","GDM1")
  data(data_lower_silesian)
  res<-optSmacofSym_mMDS(data_lower_silesian,,normalizations=metnor,distances=metdist,
    mdsmodels=metscale, spline.degrees=c(2:3),outDec=".")
  stress<-as.numeric(gsub(",",".",res[,"STRESS 1"],fixed=TRUE))
  hhi<-as.numeric(gsub(",",".",res[,"HHI spp"],fixed=TRUE))
  cs<-(min(stress)+max(stress))/2 # critical stress
  t<-findOptimalSmacofSym(res,critical_stress=cs)
  print(t)
  # plot 'old way'
  plot(stress[-t$Nr],hhi[-t$Nr], xlab="Stress-1", ylab="HHI",type="n",font.lab=3)
  text(stress[-t$Nr],hhi[-t$Nr],labels=(1:nrow(res))[-t$Nr])
  abline(v=cs,col="red")
  points(stress[t$Nr],hhi[t$Nr], cex=5,col="red")
  text(stress[t$Nr],hhi[t$Nr],labels=(1:nrow(res))[t$Nr],col="red")
  #or plot ggplot2
  plot_data <- data.frame(
     object = seq_len(nrow(res)),
     stress = stress,
     hhi = hhi,
     optimal = seq_len(nrow(res)) == t$Nr
   )
   plot_data <- plot_data[
     is.finite(plot_data$stress) &
       is.finite(plot_data$hhi),
   ]
   p <- ggplot(
     plot_data,
     aes(
       x = stress,
       y = hhi
     )
   ) +
   
   # critical stress line
   geom_vline(
     xintercept = cs,
     colour = "red",
     linewidth = 0.7
   ) +
   
   # ordinary points
   geom_point(
     data = subset(
       plot_data,
       !optimal
     ),
     shape = 16,
     size = 2.2
   ) +
   
   # labels for ordinary points
   geom_text_repel(
     data = subset(
       plot_data,
       !optimal
     ),
     aes(
       label = object
     ),
     size = 3.5,
     box.padding = 0.45,
     point.padding = 0.30,
     force = 2,
     max.overlaps = Inf,
     min.segment.length = 0,
     seed = 123
   ) +
   
   # optimal solution highlighted by a large red circle
   geom_point(
     data = subset(
       plot_data,
       optimal
     ),
     shape = 16,
     size = 3,
     stroke = 1.2,
     colour = "red"
   ) +
   
   # label for optimal solution
   geom_text_repel(
     data = subset(
       plot_data,
       optimal
     ),
     aes(
       label = object
     ),
     colour = "red",
     fontface = "bold",
     size = 4,
     box.padding = 0.7,
     point.padding = 0.8,
     force = 3,
     max.overlaps = Inf,
     min.segment.length = 0,
     seed = 123
   ) +
   
   labs(
     x = "Stress-1",
     y = "HHI"
   ) +
   
   theme_classic(
     base_size = 12
   ) +
   
   theme(
     axis.title = element_text(
       face = "italic"
     )
   )
   print(p)
   

mdsOpt documentation built on Oct. 2, 2026, 5:09 p.m.