Chapter 14 AppendixOne-Way Analysis of Variance with Excel, JMP, Minitab, SPSS, CrunchIt!, R, and TI-83/-84 Calculators

TA14-1

One-way analysis of variance (ANOVA) extends the two-sample test to more than two groups. The null hypothesis is and the alternative hypothesis is at least one population mean is different from the rest. You have already met the basic ANOVA table that is part of the standard regression output. Here, the terms in the table take on a different meaning.

The first step is to graphically examine the distributions of the groups for (approximate) Normality and outliers (we don’t want any of these). We also use descriptive statistics to compare the standard deviations in terms of satisfying the basic assumption that all groups have the same population variance (which is generally considered fulfilled if twice the smallest standard deviation is larger than the biggest standard deviation).

Data Analysis and ANOVA

image

ANOVA in Excel requires that the different group (treatment) observations be in separate columns, If they are not, copy and paste so each group has its own column.

For summary statistics on each group, use Data ➔ Data Analysis ➔ Descriptive Statistics.

  1. Drag the cursor to select the input range (the columns with your data).
  2. If you have included the column header (this labels the results), check the box for “Labels” in first row.
  3. Check the box for “Summary Statistics” (the default is to put the statistics in a new worksheet page). Click “OK.”
  4. Compare the largest and smallest standard deviations. If twice the smallest is more than the largest, you have met the “equal variability” assumption.

Unfortunately, Excel cannot make stemplots or side-by-side boxplots to visually examine the data for symmetry and outliers. If this is your only technology, you will have to create those by hand.

To perform the ANOVA, use Data ➔ Data Analysis ➔ ANOVA: Single Factor.

  1. Drag the cursor to select the input range (the columns with your data).
  2. If you have included the column header (this labels the results), check the box for “Labels” in first row.
  3. The default is to put the results in a new worksheet. Click “OK” for the results of the test.

The Excel Video Technology Manual: One-Way ANOVA gives more information and an example.

TA14-2

image

The data analysis and test can all be done through Analyze ➔ Fit Y by X.

  1. Click to select and enter the response variable (Y) into its box and the explanatory (X, Factor) variable (which must be modeling type Nominal) into its box. Click “OK.”
  2. You are presented with a version of a dotplot of the data for each group. This plot by itself can help you locate any potential outliers. To create side-by-side boxplots of the data, click the red triangle and select Display Options ➔ Box Plots. Examine these for outliers and relative symmetry.
  3. Click the red triangle and select “Means and Std Dev.” If twice the smallest standard deviation is more than the largest, you have met the “equal variability” assumption.
  4. Click the red triangle and select “Means/ANOVA.” This gives the ANOVA table and other summary statistics.

The JMP Video Technology Manual: One-Way ANOVA gives more information and an example.

image

Use Stat ➔ ANOVA ➔ One-Way.

  1. Use the drop-down to tell Minitab what your data layout is (response values all in a single column with a separate column of group labels, or each group in its own column).
  2. Click to select and enter the column(s) of data and the factor column (if that layout is being used).
  3. Click “Graphs.” Check the box to obtain a boxplot of data. Click “OK” twice.
  4. Examine the boxplots for outliers and relative symmetry. If no problems are seen, minimize or close the graph window to see the ANOVA results.
  5. Scroll backwards in the results window. You’ll see summary statistics for each group. If twice the smallest standard deviation is more than the largest, you have met the “equal variability” assumption.
  6. Scroll up the results window further for the ANOVA table results.

The Minitab Video Technology Manual: One-Way ANOVA gives more information and an example.

image

SPSS must have numeric group identifiers. If the grouping variable is categorical, you will have to create a numeric version. Use Transform ➔ Recode into Different Variables.

  1. Select and enter the original variable into the box.
  2. Give the new variable a name in the box labeled “Name” and click “Change.”
  3. Click “Old and New Values.”
  4. For each value of the original variable, type it into the Old Value box (exactly as entered) and enter a numeric value into the New Value box. Click “Add.” Repeat until you have assigned numeric labels to all the groups. Click “Continue” and “OK.”

TA14-3

For summary statistics and graphs, use Analyze ➔ Descriptive Statistics ➔ Explore.

  1. Click to select and enter the response variable into the “Dependent” list and either of the two group identifiers into the “Factor” list.
  2. Click “OK” for the default of summary statistics, stemplots, and boxplots for each group. If twice the smallest standard deviation is more than the largest, the data meet the “equal variability” condition.

Perform the ANOVA using Analyze ➔ Compare Means ➔ One-Way ANOVA. Enter the response variable in the “Dependent” list and the numeric group identifier in the “Factor” list. Click “OK” for the results.

The SPSS Video Technology Manual: One-Way ANOVA gives more information and an example.

image

For side-by-side boxplots (presuming you have one column of data and a separate column that indicates group), click Graphics ➔ Boxplots. Click the “Grouped” tab. Click to enter the response (data) variable and the factor (group by) variables. Click “Calculate.” If these plots look reasonably symmetric with no outliers, the “approximately Normal” condition is satisfied.

Compare standard deviations. Click Statistics ➔ Descriptive Statistics. Click the “Grouped” tab. Click to enter the response (data) variable and the factor (group by) variables. Click “Calculate.” If twice the smallest standard deviation is more than the largest, the data meet the “equal variability” condition.

Compute the ANOVA. Click Statistics ➔ ANOVA ➔ One-way. Here there is an option for the type of data layout—one column of data and a column for grouping (Grouped), or each group in a separate column (Columns). Click the appropriate tab. Click to enter the variables, then click “Calculate” for the results.

image

TI calculators can display up to three side-by-side boxplots at once. Enter the data for each group into separate lists. Use (Stat Plots) to define the boxplots for each group using the plot that identifies outliers (if they exist). If no outliers are seen and each distribution is relatively symmetric, the “approximately Normal” condition is satisfied.

Use image (Calc) 1:1-VarStats on each list to find the standard deviations for each list of data. If twice the smallest standard deviation is more than the largest, the data meet the “equal variability” condition.

Use image image (Tests) ANOVA to perform the test. This command is the last one on the Tests menu, so pressing image once to find it is easier than scrolling down. For parameters, enter the names of all the lists that contain your data, separated by commas. Note that TI calculators do not give the “Total” line for the ANOVA table, but its sum of squares and df are simply the sum of the other two entries.

The TI-83/-84 Video Technology Manual: One-Way ANOVA gives more information and an example.

TA14-4

image

For side-by-side boxplots (presuming you have one column of data and a separate column that indicates group), use a command of the following form:

> boxplot(Response ~ Group)

Examine this plot for “approximate Normality” and outliers. If satisfied, compare variability of the groups using

> numSummary(Response,group=Group)

If you only want to look at the standard deviations, you can use

> Tapply(Response,Group,sd)

If twice the smallest standard deviation is more than the largest, the data meet the “equal variability” condition. If conditions are satisfied, perform the ANOVA:

> mod <- aov(Response ~ Group)

The command

> summary(mod)

returns the ANOVA table.

The R Video Technology Manual: One-Way ANOVA and Pairwise Comparisons gives more information and an example.

Comparing Group Means

A significant ANOVA only tells us at least one population mean is different from the rest. We’d like to know which one(s) differ.

image

Excel has no built-in function to calculate these intervals and tests.

image

JMP does not compute contrasts.

It has four different methods to compute simultaneous confidence intervals (the LSD—labeled t in JMP—Tukey’s HSD, and two others), but none of these are the Bonferroni method described in your text. To access any of these, click the red triangle at the top of the ANOVA results, select “Compare Means,” and select a method. Output will be added to the bottom of the ANOVA results.

image

Minitab does not compute contrasts.

It has four different methods to compute simultaneous confidence intervals (the LSD—labeled Fisher in Minitab—Tukey’s HSD, and two others), but none of these are the Bonferroni method described in your text. To access any of these, click the “Comparisons” button in the main ANOVA dialog and check the box for the comparison type you desire. Output will be added to the bottom of the ANOVA results.

TA14-5

image

To create a contrast, click “Contrasts” at the upper right of the One-Way ANOVA dialog. Enter the coefficients for the contrast (specify a coefficient for each group) and click “Add” after each. To add another contrast, click “Next.” When finished adding contrasts, click “Continue” to return to the main dialog.

To compute simultaneous confidence intervals, click “Post Hoc” in the main ANOVA dialog. Check the box for the type of intervals you would like. There are several methods to choose from; the Bonferroni method described in your text is on the left-hand column. Click “Continue” to return to the main dialog.

image

Crunchit cannot compute these intervals and tests.

image

TI calculators cannot compute these intervals and tests.

image

For Bonferroni multiple comparisons, you can use the command

> pairwise.t.test(Response,Group,p.adj=‘bonferroni’)

This gives a matrix of -values for testing equality of means. Another option is

> TukeyHSD(mod)

where mod was used to store the model in the aov command. This gives pairwise comparisons of all possible combinations of group means with confidence intervals for the differences as well as -values. By default, the family-wise confidence level is 95%.