Dear matlab,
I have z-scores of 2 groups. I want to compare them.
What test in matlab should I use for relative comparison using just the z scores?
Thanks in advance for any guidance!
Joanne

4 Comments

the cyclist
the cyclist on 25 Mar 2023
Edited: the cyclist on 25 Mar 2023
Another user and I both wrote answers, and then we both deleted them. I can't say why the other person did it, but I did it because after I read your question a bit more carefully, I realized there was too much room for you to misinterpret what I wrote.
So, here are a few clarifying questions about what you are trying to do.
  • People often misuse statistical terminology. Can you clarify what you mean by "I have the z-score of 2 groups". The z-score (or standard score) often refers to a single value, relative to a group. But it sounds like maybe you have the z-statistic, the result of doing a z-test on each group. Is that right?
  • Do you have the underlying data, or only the z-statistic?
  • When you say "relative comparison", what do you really want to test/know? Do you want to know if the two groups are unlikely to have been drawn from the same underlying distribution? Or that they have different means?
We need more context to answer your question well.
Thanks Cyclist for your thoughtful response. Ok so to clarify - I have a phase-amplitude comodulogram for 17 subjects with 87 frequencies for the amplitude and 7 phases = a matrix with dimensions: 17 X 87 X 7 .
What the data is here is actually the Z-SCORES of the subjects after I ran permutaiton testing for each subject in a for loop. But now I'm like, I don't know what to do with these numbers - what test do I use in matlab to compare these groups (since they already are z-scored). I kinda feel like the ttest2 or ranksum, etc. I dont know if they're valid to use here...(?)
@Joanne Hall — As I illustrated in my Answer, unless you can reconstitute the original data from the respective means and standard deviations, there is nothing you can do to compare the two groups. Standardizing them erases any differences the two groups may once have had. However if you have the original means and standard deviations from each group, and if they are normally distributed, those are all you need to use to compare them.
Again, if you no longer have the means and standard deviations, you have my sympaties.
Thanks Star, see answr below

Sign in to comment.

 Accepted Answer

Since the zscore is simply a standardised method of expressing data, and if the mean values and standard deviation (std) values of each group are known, it is possible to map back to the original data and then do a valid comparison. However, if that information is not available and so it is not possible to cannot back-calculate to the original data, then your ability to discriminate the two gropus is likely lost, and no test will produce a valid comparison.
An example using random original and standardised data and the Wilcoxon ranksum test (assuming that the two groups are not paired) illustrates the issue —
x = randn(25,1);
y = randn(25,1)*3+5;
zx = zscore(x);
zy = zscore(y);
[p1,h1,stats1] = ranksum(x,y) % Original Data Are Significantly Different
p1 = 1.3090e-07
h1 = logical
1
stats1 = struct with fields:
zval: -5.2776 ranksum: 365
[p2,h2,stats2] = ranksum(zx,zy) % Standardised Scores OF The Original Data Are Not Significantly Different
p2 = 0.8009
h2 = logical
0
stats2 = struct with fields:
zval: -0.2522 ranksum: 624
So while the original data in this example are significantly different (the ranksum test assumes that both groups have the same underlying distribution, although the distribution itself is irrelevant), the standardised scores of the same data are not.
It is not worth the effort to compare the standardised scores, since any differences between the two groups that might have originally existed are lost in the standardisation process.
You have my sympathies.
.

4 Comments

Joanne Hall
Joanne Hall on 26 Mar 2023
Edited: Joanne Hall on 26 Mar 2023
Thanks Star for your thoughtful response as well. But how to normalize each subject before averaging them together [and separating them into group 1 and group2]?
...that is, say I go back to the orignal data, and join all subjects together into a subjects X freq. X phase (dimensions would be 17 X 87 X 7) in their oringal data form (NO z scores), just a mother matrix of values.
Don’t normalise them first. Do whatever statistics are appropriate (paired ttest or unpaired ttest2 t-test, unpaired ranksum or paired signedrank, or whatever test is appropriate) on the original data. Normalising them first makes any comparison you want to do with them impossible.
thanks star!
As always, my pleasure!

Sign in to comment.

More Answers (0)

Products

Release

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!