public class KruskalWallisGUI
extends javax.swing.JFrame
implements java.awt.event.ActionListener, java.awt.event.FocusListener, java.awt.event.ItemListener
KruskalWallis - GUI Version |
Design Conditions (samples) 2 3 or more Between-subjects
(independent samples)Mann-Whitney U Kruskal Wallis Within-subjects
(correlated samples)Wilcoxon
Signed-RankFriedman
The test operates on ordinal data, such as rankings, assessments, or questionnaire responses (where the responses are non-linear). Using the Kruskal Wallis test (or other non-parametric tests) for interval or ratio data over a parametric ANOVA is an option if there is a concern over the underlying assumptions in the distribution of the data. The researcher must bear in mind, however, that the data transformation bears a cost: Information is sacrificed. For example, interval or ratio scores of 80, 79, and 49 are converted to ranks 1, 2, and 3. Yes, information is sacrificed.
The null hypothesis is that the populations from which the samples originate have the same median. A statistically significant outcome implies that at least one of the samples (i.e., conditions) is significantly different from at least one other sample. To determine which pairs of samples differ significantly from one another, a post hoc pairwise comparisons test is performed (see below).
Launch KruskalWallisGUI from GoStats as follows:
9 7 4 9 3 5 4 5 5 9 3 2 6 2 2 3 1 1 8 4 2 9 7 2
The means (not shown) are 7.125, 4.000, and 2.875, for the 20-29, 30-39, and 40-49 year age groups, respectively. Evidently, the participants in the 20-29 year age group liked the GPS system quite a bit, the 40-49 year participants not so much. But, are the differences between age groups statistically significant or are they perhaps just due to chance? To determine this, the Kruskal-Wallis test is performed as follows:
The test statistic (H) follows the chi-square distribution with k - 1 degrees for freedom (k = number of conditions). Since p is below the customary threshold for significance (.05), we reject the null hypothesis. The conclusion is that age is a factor in acceptance of the new design for a GPS navigator.
The test also provides H' which is corrected for ties. The difference is usually minor.
StatView provides the following output using the data above:
The test reveals that only the samples in columns 1 and 3 are significantly different, corresponding to the responses for the 20-29 and 40-49 year age groups, respectively. The verbose output provides a rough verification of this, as it shows the means by age group (column) cited earlier:
The multiple comparisons test uses the procedure given by Siegel and Castellan in "Nonparametric Statistics for the Behavioral Sciences" (McGraw-Hill, 1988, pp. 213-214; described in a posting on www.talkstats.com).
Here's the analysis:6.4 2.5 1.3 6.8 3.7 4.1 7.2 4.9 4.9 8.3 5.4 5.2 8.4 5.9 5.5 9.1 8.1 8.2 9.4 8.2 . 9.7 . .
The example above contains scores from a study on wine tasting (see http://vassarstats.net/textbook/ch14a.html).
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent ae) |
void |
focusGained(java.awt.event.FocusEvent fe) |
void |
focusLost(java.awt.event.FocusEvent fe) |
void |
itemStateChanged(java.awt.event.ItemEvent ie) |
getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setTransferHandler, update
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFront
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public void actionPerformed(java.awt.event.ActionEvent ae)
actionPerformed
in interface java.awt.event.ActionListener
public void focusGained(java.awt.event.FocusEvent fe)
focusGained
in interface java.awt.event.FocusListener
public void focusLost(java.awt.event.FocusEvent fe)
focusLost
in interface java.awt.event.FocusListener
public void itemStateChanged(java.awt.event.ItemEvent ie)
itemStateChanged
in interface java.awt.event.ItemListener