public class MannWhitneyUGUI
extends javax.swing.JFrame
implements java.awt.event.ActionListener, java.awt.event.FocusListener, java.awt.event.ItemListener
MannWhitneyU - 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 Mann-Whitney U 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.
Launch MannWhitneyUGUI from GoStats as follows:
2 4 3 6 2 5 4 4 9 8 2 3 5 4 3 2 4 4 3 5
The means (not shown) are 3.7 for the MAC users and 4.5 for the PC users. Evidently, the PC users are more right-leaning in their political views than the MAC users. But, is the difference of statistical significance or is it likely a chance outcome? To determine this, the MannWhitney test is performed:
For convenience, the test statistic U is converted to a z-score. This facilitates computing p. Since the customary threshold for statistical significance (p < .05) was not observed, the null hypothesis remains tenable, inferring a likelihood that the two samples are from the same population. We conclude there is no difference in the political leaning of MAC users vs. PC users.
The test also provides z' which is corrected for ties. The difference is usually minor.
StatView provides the following output using the data above:
Here's the analysis:2 4 3 6 2 5 4 4 9 8 2 3 5 4 3 2 . 4 . 5
The conclusion is the same. Note that "equal sample sizes" is one assumption of the parametric ANOVA that, if violated, justifies using a non-parametric test, such as the Mann-Whitney U.
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) |
static double |
getP1() |
static double |
getP2() |
static double[] |
getRanks(double[] d) |
static double |
getU() |
static double |
getZ1() |
static double |
getZ2() |
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
public static double getU()
public static double getZ1()
public static double getZ2()
public static double getP1()
public static double getP2()
public static double[] getRanks(double[] d)