Wilcoxon test problem

83 Views Asked by At

I'm trying to solve the following (standard) Wilcoxon test problem:

Let $X_i$ be the number of calls received at a call center on the days $i = 1,. . . ,30$ of one calendar month. The number of calls are, for a given month and in increasing order,

$$1,2,\dots 30$$

The null hypothesis is that the distribution of the number of calls is identical on all days (so, under $H_0$, the $X_i$ are sampled from the same distribution). There is suspicion, however, that on the first day of the month, i.e. for $i = 1$, an additional $\Delta > 0$ calls are to be expected on average. The number of calls received for the given month on day $i = 1$ is $X_1 = 30$, corresponding to the largest number of calls over all days.

$1)$ Conduct the Wilcoxon test. What is the test statistic? Find the (exact) p-value and the test result when testing at level $a = 0.05$.

$2)$ Suppose we only suspected that there is some day in $i = 1,. . . ,30$ for which there are more calls than usual ( and we do not know which day has a surplus of calls). A first approach to this might be to apply the test above to every day $i = 1,. . . ,30$ in turn. With this approach, will you be able to test whether there is a day for which there are on average more calls (versus the null hypothesis that all days have the same distribution of calls)? To answer, consider first how many rejections you would expect in this setting if, in reality, the distribution of calls is identical on all days.

$3)$ Suppose that the numbers of calls are monitored for another month with independent measurements $Y_i, i = 1,. . . ,30$. The suspicion is again that the number of calls is higher on the first day of the month, e.g. for $i = 1$, by an additional $\Delta > 0$ calls. Let $W_x$ be the Wilcoxon test statistic for the observations $X$ in the first month and $W_y$ is the Wilcoxon test statistic for the observations $Y$ in the second month of observations.

Let the test statistic $T_{\text{min}}$, be defined as $T_{\text{min}} = \min\{W_y, W_x\}$ . Let $T_{\text{max}}$ be the test statistic $T_{\text{max}} = \max\{W_x, W_y\}$. Suppose that both the measurements $X_1$ and $Y_1$ are the largest in their respective measurement series, so that $X_1 = \max_i X_i$ and $Y_1 = \max_i Y_i$. Conduct an appropriate test using first $T_{\text{min}}$, as a test statistic and then using $T_{\text{max}}$

My work: So what I did was to perform the Wilcoxon test for the pairs $\{1\dots29\}, \{30 \}$ to get that the p-value is $0.033$ so we reject the null hypothesis that on all of the days, the same number of phone calls are received.

I have a problem in the second part - if we apply the test for all $30$ possible days, than in only one of them we will reject the null hypothesis, i.e. when we have the maximum since $\frac{1}{30}<0.05<\frac{2}{30}$. So the answer seems to be yes. However, I feel like I'm missing something.

Finally, for $(3)$ don't we have that $T_{\text{min}}=T_{\text{max}}=30$ since both of $X_1$ and $Y_1$ are the maximal in the respective samples? What's the point of all that?

Any advice/confirmation would be gladly accepted!

1

There are 1 best solutions below

7
On BEST ANSWER

For (2):

(a) Even assuming all months have 30 days (not true), the idea of checking the $i$th day of each month against the other 29 would entail 30 tests altogether. At the 5% level you would expect $30(.05) = 1.5$ rejections. That alone should tell you this is not the greatest approach. Maybe that is the point of the problem.

(b) But that leaves the question whether there is something sensible to do. I would plot the data and look for monthly periodicities. That's just a graphical approach, but I would want to take a look before going on to formal tests. Perhaps make a $12 \times 30$ matrix, make a boxplot of the means of its rows, and see if there is a far outlier. If so test the corresponding day against the others and see if it is significantly different. But by picking out one day of the month in this way, I wonder what the true significance level would be.

For another way of looking for an unusual day, you might do a chi-squared test of homogeneity, treating the matrix as a contingency table. If the null hypothesis of homogeneity is rejected, then look at Pearson residuals to see where the major discrepancies are. But I'm not sure this method has good power.

Addendum: Here is an experiment in R with fake Poisson counts:

x = rpois(12, 50)       # avg 50 calls on first days of months
y = rpois(360-12, 30)   # avg 30 calls on other days
wilcox.test(x, y)

        Wilcoxon rank sum test with continuity correction

data:  x and y
W = 4132, p-value = 7.703e-09                               # very highly signif
alternative hypothesis: true location shift is not equal to 0

boxplot(x, y, varwidth=T, horizontal=T, col="skyblue2")     # thin plot as 12 days

enter image description here

Another experiment with respective Poisson means 50 and 45 is still highly significant with P-value 0.005768.