Qscores: Showing the Data to Visualize WMWprob
WMW() returns transformed values for Y that allow plotting the data in a manner consistent with this methodology.
Step 1. Ignoring the groups, compute for all non-NA values of Y in groups A and B,
q[i] = (#(Y < Y[i]) + #(Y[i] = Y)/2)/Ntotal; i = 1 to Ntotal,
where #() is the count of TRUE values and Ntotal is the total number of non-NA observations. For example, if Ntotal = 99 and Y[6] is the untied 20th largest value (greater than 19 of all Y values), then q[6] = (19 + 0.50)/99 = 19.5/99. If Y[61] is the untied median of among all Y values, q[61] = (49 + 0.50)/99 = 49.5/99 = 0.50. If Y[17] = Y[82] are the tied sole minima, then q[17] = q[82] = (0 + 2/2)/99 = 1/99. If Y[5] is the solitary maximum, then q[5] = (98 + 0.50)/99. = 98.5/99. Note that mean(q) = 0.50.
q[i] = (#(Y < Y[i]) + #(Y[i] = Y)/2)/Ntotal; i = 1 to Ntotal,
where #() is the count of TRUE values and Ntotal is the total number of non-NA observations. For example, if Ntotal = 99 and Y[6] is the untied 20th largest value (greater than 19 of all Y values), then q[6] = (19 + 0.50)/99 = 19.5/99. If Y[61] is the untied median of among all Y values, q[61] = (49 + 0.50)/99 = 49.5/99 = 0.50. If Y[17] = Y[82] are the tied sole minima, then q[17] = q[82] = (0 + 2/2)/99 = 1/99. If Y[5] is the solitary maximum, then q[5] = (98 + 0.50)/99. = 98.5/99. Note that mean(q) = 0.50.
Step 2. Let q1 and q2 be the bifurcation of q for groups A and B, respectively. q1 and q2 have n1 and n2 elements. It can be shown that
WMWprob = mean(q1) - mean(q2) + 0.50.
Apply the common formula for the standard error of mean(q1) - mean(q2),
SE.q1vsq2 = sqrt(var(q1)/n1 + var(q2)/n2).
Define SEratio = SE.WMWprob/SE.q1vsq2, where SE.WMWprob is the estimated standard error of WMWprob as per the Mee or Newcombe3 method. Create Qscore1 and Qscore2 from q1 and q2 using
Qscore1 = SEratio*q1 + (1-SEratio)*mean(q1);
Qscore2 = SEratio*q2 + (1-SEratio)*mean(q2).
Note. WMW() returns the object $Qscore with elements aligned with the elements in the original Y object. Any observation with Y = NA or one not from the designated two groups yields a Qscore of NA.
WMWprob = mean(q1) - mean(q2) + 0.50.
Apply the common formula for the standard error of mean(q1) - mean(q2),
SE.q1vsq2 = sqrt(var(q1)/n1 + var(q2)/n2).
Define SEratio = SE.WMWprob/SE.q1vsq2, where SE.WMWprob is the estimated standard error of WMWprob as per the Mee or Newcombe3 method. Create Qscore1 and Qscore2 from q1 and q2 using
Qscore1 = SEratio*q1 + (1-SEratio)*mean(q1);
Qscore2 = SEratio*q2 + (1-SEratio)*mean(q2).
Note. WMW() returns the object $Qscore with elements aligned with the elements in the original Y object. Any observation with Y = NA or one not from the designated two groups yields a Qscore of NA.
It is easy to show that
Thus, plotting the Qscores by group displays the individual data points in a manner that aligns with a WMW analysis. See Example 5.
- The average of all Qscores is 0.50.
- WMWprob = mean{Qscore1} - mean{Qscore2} + 0.50. Thus, the difference between the means of the groups' Qscores accurately reflects the estimated WMWprob.
- SE.WMWprob = sqrt(var(Qscore1)/n1 + var(Qscore2)/n2). Thus, the spread of the groups' Qscores accurately reflects the estimated standard error of the estimated WMWprob.
Thus, plotting the Qscores by group displays the individual data points in a manner that aligns with a WMW analysis. See Example 5.