What inspired this Wish List Request?
This is a request from Koji Uehara-sama at Nice Corporation.
Please describe the new or improved feature or solution you would like to see.
Mantel test for two distance matrices are used when you want to check the relationship between two distance matrices. The following is a sample script (created by me).
Clear Symbols();
Names Default To Here(1);
///////////////////////////////////////////////////////
// Sample Data
Random Reset(11111111);
n = 8;
x1 = (1::n)`+J(n,1,Round(Random Normal(0,3),1));
x2 = (1::n)`+J(n,1,Round(Random Normal(0,3),1));
// The followings are two input ditance matrices.
d1 = Sqrt(Distance(x1,x1));
d2 = Sqrt(Distance(x2,x2));
///////////////////////////////////////////////////////
cacl permutation corr = Function({d1, d2, NSim=100000, seed=1111111}, {Default Local},
p = NCol(d1);
y1 = J(p*(p-1)/2,1,.);
y2 = J(p*(p-1)/2,1,.);
k = 0;
For(i = 1, i <= p - 1, i++,
For(j = i+1, j<=p, j++,
k++;
y1[k] = d1[i,j];
y2[k] = d2[i,j];
)
);
sr = Correlation(y1||y2)[1,2];
two tail = 0;
greater = 0;
smaller = 0;
eps = 1e-8;
r0 = J(NSim,1,.);
For(ii = 1, ii <= NSim, ii++,
Wait(0);
If(Mod(ii,5000)==0, Write("Simulation:"||Char(ii)||"\!N"));
Wait(0);
ind = Random Shuffle(1::NCol(d1));
d22 = d2[ind,ind];
y2 = J(p*(p-1)/2,1,.);
k = 0;
For(i = 1, i <= p - 1, i++,
For(j = i+1, j<=p, j++,
k++;
y2[k] = d22[i,j];
)
);
pr = Correlation(y1||y2)[1,2];
r0[ii] = pr;
two tail += (Abs(pr) >= Abs(sr)-eps);
greater += pr >= sr-eps;
smaller += pr <= sr+eps;
);
Eval List({two tail/NSim, greater/NSim, smaller/NSim, r0})
);
{two tailed p, one tailed greater p, one tailed smaller p, r0}
= cacl permutation corr(d1, d2, NSim=100000, seed=1111111);
Show(two tailed p, one tailed greater p, one tailed smaller p);
dt = As Table(r0,<<COLUMN names=""></COLUMN>
What would the value be to you and/or other users if this new feature is provided?
I do not know.
Is this an external customer request?
Yes, Koji Uehara-sama at Nice Corporation requested this feature.
Is there a competitive software package that has this feature or solution that we should be aware of?
I think you can do this on R.
Will this impact a renewal, expansion, or adoption at a customer, and does this put an account at risk if we do not address this?
No.
I found that Mantel's test was requested about four years ago.
https://jmpdiscovery.atlassian.net/browse/JMP-9834
The user can use JMP Pro (at least now), and we have now the Distance Matrix platfrom in JMP Pro, so it seems the shortest path for realizing the user's request that the Distance Matrix will support Mantel's test.