In need of a specific statistic test

1 次查看(过去 30 天)
Shay
Shay 2012-4-24
回答: TED MOSBY 2024-10-10
Hi,
I am looking for a single-tailed, paired, non-parametric statistic test.
Specifically, I have (Xi,Yi) pairs and I want to know whether X is consistently larger than Y, or vica versa, in a significant manner (i want to be able to quantify the significance either way).
Is there such a thing implemented in Matlab? Ranksum and signrank are close to what i need but are both two-tailed.
Thanks!
Shay

回答(1 个)

TED MOSBY
TED MOSBY 2024-10-10
Hi Shay,
The ‘signrank function in MATLAB is a two-tailed test by default, but you can specify it to perform a one-tailed test using the ‘tail’ parameter. After setting this parameter, you can test a specific directional hypothesis:
  • 'tail', is set to'right': Tests if the median of X - Y is greater than zero (i.e., X is consistently greater than Y).
  • 'tail', is set to 'left': Tests if the median of X - Y is less than zero (i.e., Y is consistently greater than X).
I wrote an example of how to usesignrank for a one-tailed test which you can refer:
% Your data
X = [...]; % Your X values
Y = [...]; % Your Y values
% Perform the Wilcoxon signed-rank test (one-tailed)
[p, h, stats] = signrank(X, Y, 'tail', 'right'); % Test if X is greater than Y
% Alternatively, test if Y is greater than X
% [p, h, stats] = signrank(X, Y, 'tail', 'left');
% Display the results
fprintf('p-value: %f\n', p);
fprintf('Test statistic: %f\n', stats.signedrank);
fprintf('Hypothesis result (1 if rejected, 0 if not): %d\n', h);
Here is the documentation for the ‘signrank’ function:
Hope this helps!

类别

Help CenterFile Exchange 中查找有关 Psychology 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by