You are here: Symbol Reference > Dew Namespace > Dew.Stats Namespace > Classes > TMtxMDScaling Class
Dew Stats for .NET
ContentsIndexHome
Example

The "beauty" of MDS is that we can analyze any kind of distance or similarity matrix. These similarities can represent people's ratings of similarities between objects, the percent agreement between judges, the number of times a subjects fails to discriminate between stimuli, etc. For example, MDS methods used to be very popular in psychological research on person perception where similarities between trait descriptors were analyzed to uncover the underlying dimensionality of people's perceptions of traits (see, for example Rosenberg, 1977). In this example 6x6 similarities (extracted directly from questionare correlation matrix) is used to perform classical MD scaling.

using Dew.Stats; using Dew.Stats.Units; using Dew.Math; namespace Dew.Examples { private void Example(StatTools.TMtxMDScaling mds) { // similarities matrix (symmetric with 1.0 on diagonal) mds.Data.SetIt(5,5,false, new double[] { 1.00, 0.3, 0.2, 0.25, 0.33, 0.30, 1.0, 0.11, 0.21, 0.8, 0.20, 0.11, 1.0, 0.40, 0.5, 0.25, 0.21, 1.0, 0.10, 0.05, 0.33, 0.80, 0.5, 0.05, 1.00}); mds.DataFormat = TMDDataFormat.mdFormatSimilarities; // use "standard" Euclidian metric mds.DistanceMethod = TPWDistMethod.pwdistEuclidian; // define number of desired dimensions (1) mds.Dimensions = 1; // Do the math mds.Recalc(); // check Stress, DHat, EigeValues to evaluate GOF if (1) dimension is used } }
Copyright (c) 1999-2024 by Dew Research. All rights reserved.