In: Statistics and Probability
A study was conducted to examine the difference in house prices in A, B, C and D. Selling pricing were sampled from four houses in each city. The prices for Cities are given (in thousands of CAD) in the Excel spreadsheet. Based on these data, perform a Kruskal-Wallis test to decide if there is a difference in house prices between these cities. Be sure that you carefully define null and alternative hypotheses. Make your conclusions at the 0.10 significance level.
Data given below:
B | A | C | D |
289 | 488 | 518 | 524 |
512 | 496 | 506 | 504 |
408 | 505 | 525 | 575 |
494 | 502 | 522 | 582 |
First, all the data needs to be put together in one column as shown below:
Sample | Value |
1 | 488 |
1 | 496 |
1 | 505 |
1 | 502 |
2 | 289 |
2 | 512 |
2 | 408 |
2 | 494 |
3 | 518 |
3 | 506 |
3 | 525 |
3 | 522 |
4 | 524 |
4 | 504 |
4 | 575 |
4 | 542 |
Now, the data needs to be organized in ascending order by value (keeping track of what sample the values belongs to). The results are shown below:
Sample | Value (In Asc. Order) |
2 | 289 |
2 | 408 |
1 | 488 |
2 | 494 |
1 | 496 |
1 | 502 |
4 | 504 |
1 | 505 |
3 | 506 |
2 | 512 |
3 | 518 |
3 | 522 |
4 | 524 |
3 | 525 |
4 | 542 |
4 | 575 |
Now, we need to assign ranks to the values that are already organized in ascending order. Make sure that take the average of ranks in case of rank ties (Ex. If two values shared the first place in the list, instead of assigning rank 1 and rank 2 to them, assign rank 1.5 to both) The following ranks are obtained:
Sample | Value (In Asc. Order) | Rank | Rank (Adjusted for ties) |
2 | 289 | 1 | 1 |
2 | 408 | 2 | 2 |
1 | 488 | 3 | 3 |
2 | 494 | 4 | 4 |
1 | 496 | 5 | 5 |
1 | 502 | 6 | 6 |
4 | 504 | 7 | 7 |
1 | 505 | 8 | 8 |
3 | 506 | 9 | 9 |
2 | 512 | 10 | 10 |
3 | 518 | 11 | 11 |
3 | 522 | 12 | 12 |
4 | 524 | 13 | 13 |
3 | 525 | 14 | 14 |
4 | 542 | 15 | 15 |
4 | 575 | 16 | 16 |
In order to compute the sum of rank for each sample, it is easier to organize the above table by samples. The following is obtained:
Sample | Value | Rank (Adjusted for ties) |
1 | 488 | 3 |
1 | 496 | 5 |
1 | 502 | 6 |
1 | 505 | 8 |
2 | 289 | 1 |
2 | 408 | 2 |
2 | 494 | 4 |
2 | 512 | 10 |
3 | 506 | 9 |
3 | 518 | 11 |
3 | 522 | 12 |
3 | 525 | 14 |
4 | 504 | 7 |
4 | 524 | 13 |
4 | 542 | 15 |
4 | 575 | 16 |
With the information provided we can now easily compute the sum of ranks for each of the samples:
R1 = 3 + 5 + 6 + 8 = 22
R2 = 1 + 2 + 4 + 10 = 17
R3 = 9 + 11 + 12 + 14 = 46
R4 = 7 + 13 + 15 + 16 = 51
(1) Null and Alternative Hypotheses
The following null and alternative hypotheses need to be tested:
Ho: The samples come from populations with equal medians
Ha: The samples come from populations with medians that are not all equal
The above hypotheses will be tested using the Kruskal-Wallis test.
(2) Rejection Region
The combination of sample sizes does not allow to find a critical value for this Kruskal-Wallis test, please try increasing the sample sizes. Please consult with a Kruskal-Wallis test to check which combinations of sample sizes lead to meaningful critical values.