MSTRS
Computes various stress criteria in multidimensional scaling.
Required Arguments
DIST — Vector of length N containing the distances. (Input)
Missing values are not allowed in DIST.
DISP — Vector of length N containing the disparities. (Input)
A — The intercept. (Input)
If INTCEP = 0, A is not used.
B — The slope. (Input)
If ISLOPE = 0, B is not used.
POWER — Power to use in the stress function. (Input)
POWER must be greater than or equal to 1.
STRSS — The computed stress criterion. (Output)
WT — The weight used in computing the stress. (Output)
If the weight is too large, a maximum weight is used. See the Description section.
Optional Arguments
N — Number of distances and disparities. (Input)
Default: N = size (DIST,1).
INTCEP — Intercept option parameter. (Input)
If INTCEP = 0, the intercept is not used in the model. If INTCEP = 1, the intercept is used in the model.
Default: INTCEP = 1.
ISLOPE — Slope option parameter. (Input)
If ISLOPE = 0, the slope B is not used. If ISLOPE = 1, the slope is used.
Default: ISLOPE = 1.
ISTRS — Stress option parameter. (Input)
Default: ISTRS = 1.
ISTRS
Stress Criterion Used
0
Log stress
1
Stress weighted by the inverse of the sum of the squared disparities
2
Stress weighted by the inverse of the sum of the centered squared disparities
FORTRAN 90 Interface
Generic: CALL MSTRS (DIST, DISP, A, B, POWER, STRSS, WT [])
Specific: The specific interface names are S_MSTRS and D_MSTRS.
FORTRAN 77 Interface
Single: CALL MSTRS (N, DIST, DISP, INTCEP, A, ISLOPE, B, POWER, ISTRS, STRSS, WT)
Double: The double precision name is DMSTRS.
Description
Routine MSTRS computes the value of stress criteria commonly used in multidimensional scaling. Routine MSTRS allows transformed values of the disparities and distances to be input and will compute the stress on the transformed values. Additionally, the user can input a slope and/or an intercept to be used in the stress computations, and the stress can be computed using an arbitrary Lp norm as well as the squared error norm in which p = 2.
Let
denote a disparity, δi denote the corresponding distance, α denote the intercept, and let β denote the slope. If INTCEP = 0, then set α = 0. If ISLOPE = 0, then set β = 1.
Set ɛ = 0.001, and let
When ISTRS = 0, the stress is computed as
where n is the number of nonmissing disparities, and p = POWER is the power to be used. This stress formula, when optimized, can lead to to normal distribution theory maximum likelihood estimation. It can not be used in nonmetric scaling. The weight is computed as n/max(nɛ).
When ISTRS is 1, the stress is computed as
and the weight returned is given as
Takane, Young, and de Leeuw (1977) recommend using this formula when the data is not column conditional (i.e., whenever the stress is computed over one or more dissimilarity matrices rather than over one column in a single matrix). When ISTRS = 2, the stress is given by
where
is the average of the nonmissing disparities. The weight is computed as
Takane, Young, and de Leeuw (1977) recommend this stress for column conditional data.
Missing values (NaN) are not allowed in DIST while missing disparities in DISP are not used in the computations. If all disparities are missing, the stress criteria is set to 0, and the weight (WT) is set to missing (NaN).
In general, a single call to MSTRS would be made for each strata (“conditionality group”) in the data.
Example
The following example illustrates the computation of stress when the log of the distances and disparities are input. For this example, ISTRS is 1 and POWER is 2.
 
USE MSTRS_INT
USE UMACH_INT
USE SDOT_INT
 
IMPLICIT NONE
INTEGER INTCEP, ISLOPE, ISTRS, N
REAL A, POWER
PARAMETER (A=0.0, INTCEP=0, N=10, POWER=2.0)
!
INTEGER I, NOUT
REAL ALOG, B, DISP(N), DIST(N), STRSS, WT
INTRINSIC ALOG
!
DATA DIST/4.0, 1.5, 1.25, 3.0, 1.75, 2.0, 1.0, 3.5, 2.5, 3.75/
DATA DISP/4.0, 1.0, 1.0, 3.0, 1.0, 2.0, 1.0, 3.0, 2.0, 4.0/
! Transform the data
DO 10 I=1, N
DIST(I) = ALOG(DIST(I))
DISP(I) = ALOG(DISP(I))
10 CONTINUE
! Compute a slope
B = SDOT(N,DISP,1,DIST,1)/SDOT(N,DIST,1,DIST,1)
! Compute the stress
CALL MSTRS (DIST, DISP, A, B, POWER, STRSS, WT, INTCEP=INTCEP)
! Print results
CALL UMACH (2, NOUT)
WRITE (NOUT,99999) STRSS, WT
!
99999 FORMAT (' STRSS = ', F12.4, ' WT = ', F12.4)
END
Output
 
STRSS = 0.0720 WT = 0.1385