function [ES] = cliffsDelta(V1, V2) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %Calculates Cliff's delta, a non-parametic measure of the effect size % Inputs: % - V1: The first vector of data % - V2: The second vector of data. The lengths do not necessarilly need % to match % Output: % - ES: Cliff's delta, AKA the effect size %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% parfor fn = 1:length(V1) ESM = sign(V1-V2(fn)); trackESM(fn) = nansum(ESM); end ES = sum(trackESM)/(length(V1)*length(V2)); end