public class LillieforsGUI
extends javax.swing.JFrame
implements java.awt.event.ActionListener, java.awt.event.FocusListener, java.awt.event.ItemListener
Normality Test (Lilliefors) - GUI Version |
The calculations leading to the test statistic are identical for the K-S and Lilliefors tests. The difference lies in the critical value against which the test statistic is compared. Since the Lilliefors test uses the sample mean and sample standard deviation in building the observed distribution against which the expected distribution is compared, the test statistic is more conservative, thus increasing the likelihood of accepting the null hypothesis. To compensate for this and to maintain the desired alpha, the Lilliefors test uses a more stringent set of critical values in assessing the test statistic.
As with the chi-square goodness-of-fit test, the Lilliefors test compares observed and expected values. However, the comparisons are not between the counts or frequencies among nominal-scale attributes of people, systems, interaction techniques, or such. Instead, the comparisons are between the observed and expected cumulative frequencies in two distributions. The expected cumulative frequency (ECF) is for a normal distribution, as represented in standardized z scores. The observed cumulative frequency (OCF) is developed from the sample data.
In the image below – gleaned from Wikipedia ( click here) – the expected cumulative frequency (ECF) distribution is shown in red while the observed cumulative frequency (OCF) distribution is shown in blue.
The test statistic (M) is shown in black. It is the largest vertical difference between the ECF and the OCF. If M exceeds a threshold – the critical value (CV) – the null hypothesis of normality is rejected. If the test statistic is less than the critical value, the null hypothesis is retained.![]()
Launch LillieforsGUI from GoStats as follows:
The responses consist of 15 scores, or sample points, with a mean of 34.3 (SD = 4.9). The researcher wishes to determine if the distribution of the responses is normally distributed. To test this, LillieforsGUI is used as follows:33, 28, 31, 33, 33, 32, 34, 33, 41, 43, 42, 34, 36, 37, 25
The test statistic is M = 0.1937. This is compared against a critical value extracted from a look-up table built-in to the GoStats utility. For n= 15 and α = .05, the critical value CV = 0.2196. Since M < CV, the null hypothesis of normality is not rejected: It is concluded that the responses follow a normal distribution.
Note above that the "Summary" output option is selected. More detailed output is obtained using the "Table" output option:
Briefly, the columns in the table are
The test statistic (M) is largest value in columns E and F (see above). This is compared against the critical value, which is read from a look-up table, and the appropriate conclusion is made. Full details of the calculations leading to the output above are found in Sheskin's Handbook of Parametric and Nonparametric Statistical Procedures (5th ed.), 2011, CRC Press (Test #7, pp. 261-275).
Using a MATLAB utility, a cumulative frequency chart can be made for the analysis above:
The test statistic appears as a black arrow.
The data are the x-coordinates of selection, mapped so that 0.0 is the centre of the target. Negative values are selections on the near side, positive values are selections on the far side. Although the data include selections near the centre of the target and selections on either side, the researcher questions whether the data follow a normal distribution. To determine this, the Lilliefors test is used:-13.9, -13.9, -26.6, -7.5, -14.6, -13.5, -15.2, 33.1, -10.7, 36.8 2.4, -12.2, -1.5, -24.5, 21.8, 17.3, 1.9, 23.7, -6.7, -11.0
As seen in the last three lines of output, the test statistic (M = 0.2054) exceeds the critical value (CV = 0.1920); therefore, the null hypothesis is rejected. The conclusion is that the selection coordinates for the sequence of trials are not normally distributed.
An alternative output option is "Single-line":
The single-line output option is useful when analysing a collection of data sets.
A requirement of LillieforsGUI is that all the points for a data set are on a single line in the data file (comma or space delimited). It is possible to combine multiple data sets in one file, provided each set is on a separate line. This is demonstrated in the next example.
The example above is from an experiment using a Fitts' law task to investigate touch-based target selection on a mobile phone:
The full results are published in MacKenzie's Fitts Throughput and the Remarkable Case of Touch-based Target Selection, presented at HCI International 2015. In all, there were 1920 sequences of trials with 20 selections per sequence.
As shown, the null hypothesis of normality is retained for 1789 of the 1920 data sets. That's 93.2% of the data sets.
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) |
boolean |
isNormal(double[] data) |
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 boolean isNormal(double[] data)