R: An application of GDM2 distance for ordinal data to compute...

pattern.GDM2 {clusterSim} | R Documentation

## An application of GDM2 distance for ordinal data to compute the distances of objects from the pattern object (upper or lower)

### Description

An application of GDM2 distance for ordinal data to compute the distances of objects from the upper (ideal point co-ordinates) or lower (anti-ideal point co-ordinates) pattern object

### Usage

    pattern.GDM2(data, performanceVariable, nomOptValues=NULL,
    weightsType="equal", weights=NULL, patternType="upper",
    patternCoordinates="dataBounds", patternManual=NULL,
    nominalTransfMethod=NULL)

### Arguments

`data` | matrix or dataset
`performanceVariable` | vector containing three types of performance variables: `s` for stimulants where higher value means better performance `d` for destimulants where low values indicate better performance `n` for nominants where the best value is implied. Object performance is positively assessed if the measure has implied value
`nomOptValues` | vector containing optimal values for nominant variables and NA values for stimulants and destimulants. If `performanceVariable` do not contain nominant variables this `nomOptValues` may be set to NULL
`weightsType` | equal or different1 or different2 "equal" - equal weights "different1" - vector of different weights should satisfy conditions: each weight takes value from interval [0; 1] and sum of weights equals one "different2" - vector of different weights should satisfy conditions: each weight takes value from interval [0; m] and sum of weights equals m (m - the number of variables)
`weights` | vector of weights
`patternType` | "upper" - ideal point co-ordinates consists of the best variables' values "lower" - anti-ideal point co-ordinates consists of the worst variables' values
`patternCoordinates` | "dataBounds" - pattern should be calculated as following: "upper" pattern (maximum for stimulants, minimum for destimulants, nominal value for nominants), "lower" pattern (minimum for stimulants, maximum for destimulants) "manual" - pattern should be given in `patternManual` variable
`patternManual` | Pattern co-ordinates contain: real numbers "min" - for minimal value of variable "max" - for maximal value of variable "nom" - for nominal value of variable (for upper pattern only - given in `nomOptValues` vector)
`nominalTransfMethod` | method of transformation of nominant to destimulant variable for patternType="lower": "database" - for each nominant separately GDM2 distance is calculated between each nominant observation (with repetitions - all variable values are used in calculation) and nominal value. Next the variable observations are replaced by those distances "symmetrical" - for each nominant separately GDM2 distance is calculated between each nominant observation (without repetition - each observation is used once) and nominal value. Next the variable observations are replaced by those distances

### Details

See file ../doc/patternGDM2_details.pdf for further details

### Value

`pdata` | raw (primary) data matrix
`data` | data matrix after transformation of nominant variables (with pattern in last row)
`distances` | GDM2 distances from pattern object
`sortedDistances` | sorted GDM2 distances from pattern object

### Author(s)

Marek Walesiak marek.walesiak@ue.wroc.pl, Andrzej Dudek andrzej.dudek@ue.wroc.pl

epartment of Econometrics and Computer Science, University of Economics, Wroclaw, Poland http://keii.ue.wroc.pl/clusterSim/

### References

Jajuga, K., Walesiak, M., Bak, A. (2003), On the general distance measure, In: M. Schwaiger, O. Opitz (Eds.), Exploratory data analysis in empirical research, Springer-Verlag, Berlin, Heidelberg, 104-109. Available at: doi: 10.1007/978-3-642-55721-7_12.

Walesiak, M. (1993), Statystyczna analiza wielowymiarowa w badaniach marketingowych [Multivariate statistical analysis in marketing research]. Wroclaw University of Economics, Research Papers no. 654. Available at: http://keii.ue.wroc.pl/pracownicy/mw/1993_Walesiak_SAW_w_badaniach_marketingowych_OCR.pdf.

Walesiak, M. (1999), Distance Measure for Ordinal Data, "Argumenta Oeconomica", No. 2 (8), 167-173. Available at: http://keii.ue.wroc.pl/pracownicy/mw/1999_Walesiak_Argumenta_Oeconomica_no_2.pdf.

Walesiak, M. (2006), Uogolniona miara odleglosci w statystycznej analizie wielowymiarowej [The Generalized Distance Measure in multivariate statistical analysis], Wydawnictwo AE, Wroclaw. Available at: http://keii.ue.wroc.pl/pracownicy/mw/2006_Walesiak_Uogolniona_miara_odleglosci.pdf.

Walesiak, M. (2011), Uogólniona miara odległości GDM w statystycznej analizie wielowymiarowej z wykorzystaniem programu R [The Generalized Distance Measure GDM in multivariate statistical analysis with R], Wydawnictwo Uniwersytetu Ekonomicznego, Wroclaw. Available at: http://keii.ue.wroc.pl/pracownicy/mw/2011_Walesiak_Uogolniona_miara_odleglosci_GDM_w_SAW_z_wykorzystaniem_programu_R_errata.pdf.

Walesiak, M. (2016), Uogólniona miara odległości GDM w statystycznej analizie wielowymiarowej z wykorzystaniem programu R. Wydanie 2 poprawione i rozszerzone [The Generalized Distance Measure GDM in multivariate statistical analysis with R], Wydawnictwo Uniwersytetu Ekonomicznego, Wroclaw. Available at: http://keii.ue.wroc.pl/pracownicy/mw/2016_Walesiak_Uogolniona_miara_odleglosci_GDM.pdf.

### See Also

`dist.GDM`

### Examples

    # Example 1
    library(clusterSim)
    data(data_patternGDM2)
    res<-pattern.GDM2(data_patternGDM2,
    performanceVariable=c("s","s","s","d","d","n"),
    nomOptValues=c(NA,NA,NA,NA,NA,3), weightsType<-"equal", weights=NULL,
    patternType="lower", patternCoordinates="manual",
    patternManual=c("min","min",0,5,"max","max"),
    nominalTransfMethod="symmetrical")
    print(res)
    gdm_p<-res$distances
    plot(cbind(gdm_p,gdm_p),xlim=c(max(gdm_p),min(gdm_p)),
    ylim=c(min(gdm_p),max(gdm_p)),
    xaxt="n",xlab="Order of objects from the best to the worst",
    ylab="GDM distances from pattern object", lwd=1.6)
    axis(1, at=gdm_p,labels=names(gdm_p), cex.axis=0.5)

    # Example 2
    library(clusterSim)
    data(data_patternGDM2)
    res<-pattern.GDM2(data_patternGDM2,
    performanceVariable=c("s","s","s","d","d","n"),
    nomOptValues=c(NA,NA,NA,NA,NA,3), weightsType<-"equal", weights=NULL,
    patternType="upper", patternCoordinates="dataBounds",
    patternManual=NULL, nominalTransfMethod="database")
    print(res)
    gdm_p<-res$distances
    plot(cbind(gdm_p,gdm_p), xlim=c(min(gdm_p),max(gdm_p)),
    ylim=c(min(gdm_p),max(gdm_p)),
    xaxt="n",xlab="Order of objects from the best to the worst",
    ylab="GDM distances from pattern object", lwd=1.6)
    axis(1, at=gdm_p,labels=names(gdm_p), cex.axis=0.5)

[Package clusterSim version 0.49-2 Index]