function [p, t] = rank_transformation_ttest(X1, X2)
% function [p, t] = rank_transformation_ttest(X1, X2)
%
% rank transformation of the t-tes
%
% Dr. A. I. Hanna (2007)

X1 = X1(:);
X2 = X2(:);
X = [X1; X2];
sX = sort(X);
lim = min(sX);
ind1 = zeros(length(X1),1);
for i=1:length(X1)
    ind = find(sX==X1(i));
    ind1(i) = ind(1);
    sX(ind(1)) = lim-100;
end
ind2 = zeros(length(X2),1);
for i=1:length(X2)
    ind = find(sX==X2(i));
    ind2(i) = ind(1);
    sX(ind(1)) = lim-100;

end
[p, t] = ttest(ind1, ind2);
