Example:
As a researcher, you are presented with three separate groups of data, each of which contain six sample data points. You are tasked to discover if each group of data shares the same distribution.
The samples contained in data group one are: { 7, 4, 14, 14, 6, 5 }
The samples contained in data group two are: { 10, 14, 15, 18, 9, 15 }
The samples contained in data group three are: { 1, 16, 4, 14, 2, 3 }
We will assume an alpha value of .05.
Additionally, we can state the following hypotheses:
H0: The three probability distributions are the same.
HA: The three probability distributions are not the same.
Like its parametric counterpart, the Kruskal-Wallis H Test does not require that all sample sizes contain the same number of data points.
To perform this test within R, we will utilize the following code:
# Create the data groups and the data to populate each group #
group <- c(rep("1",6), rep("2",6), rep("3",6))
data <- c(7, 4, 14, 14, 6, 5, 10, 14, 15, 18, 9, 15, 1, 16, 4, 14, 2, 3)
# Combine both the data and the groups to create a single data set #
dataset <- data.frame(data, group)
# Perfrom analysis through the utilization of the Kruskal-Wallis Test #
kruskal.test(data~group, data=dataset)
This generates the following output:
Kruskal-Wallis rank sum test
group <- c(rep("1",6), rep("2",6), rep("3",6))
data <- c(7, 4, 14, 14, 6, 5, 10, 14, 15, 18, 9, 15, 1, 16, 4, 14, 2, 3)
# Combine both the data and the groups to create a single data set #
dataset <- data.frame(data, group)
# Perfrom analysis through the utilization of the Kruskal-Wallis Test #
kruskal.test(data~group, data=dataset)
data: data by group
Kruskal-Wallis chi-squared = 5.2315, df = 2, p-value =
0.07311
Since our p-value is greater than our stated alpha value (0.07311 > .05), we will fail to reject the null hypothesis. What this is indicating, is that at 95% confidence interval, we cannot state that through the analysis of the data provided, that the three probability distributions are not the same.
Below are the steps necessary to perform the above analysis within the SPSS platform.
Example:
Like the Mann-Whitney U-Test, within SPSS, for this particular test, data must be structured in an un-conventional manner. The cases are combined into one single variable, with their group identity providing their initial designation.
Below is our data set:
Kruskal-Wallis chi-squared = 5.2315, df = 2, p-value =
0.07311
Since our p-value is greater than our stated alpha value (0.07311 > .05), we will fail to reject the null hypothesis. What this is indicating, is that at 95% confidence interval, we cannot state that through the analysis of the data provided, that the three probability distributions are not the same.
Below are the steps necessary to perform the above analysis within the SPSS platform.
Like the Mann-Whitney U-Test, within SPSS, for this particular test, data must be structured in an un-conventional manner. The cases are combined into one single variable, with their group identity providing their initial designation.
Below is our data set:
From the “Analyze” menu, select “Nonparametric Tests”, then select “Legacy Dialogues”, followed by “K Independent Samples”.
This will generate the output below:
Again, since our p-value is greater than our stated alpha value (0.07311 > .05), we will fail to reject the null hypothesis. What this is indicating, is that at 95% confidence interval, we cannot state that through the analysis of the data provided, that the three probability distributions are not the same.
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.