One-Way ANOVA

GX-TXT DEV112 P011-bis

Compare groups with one-way ANOVA and interpret the F statistic, degrees of freedom, p-value and effect sizes.

Prepare a factor and a numeric measurement

Create a Session Standalone with Generate Session → Grouped Statistics Student Lab. Enable One-way ANOVA in Configuration → Modules. Open student.grouped.source in Dataset and check the measurement voltage_V and the text factor site. The table contains 18 observations and three sites. Some rows contain a non-finite measurement or a missing key, so you can check the chosen policy.

Selection of Grouped Statistics Student Lab in Generate Session before the Session is created.
Selection of Grouped Statistics Student Lab in Generate Session before the Session is created.

Configure classic or Welch ANOVA

  1. In Analysis → One-way ANOVA set the Dataset as primary, voltage_V as Numeric measurement and site as Group variable. You can use a numeric column for the factor when each value represents a group, for example an integer code. Check the size of each level.
  2. Choose None in Data selection for the whole sample. A saved X selection limits the rows before the comparison and can reduce the size of one or more groups. To check this choose sel_001 and use a new prefix, for example anova.selezione. The report records 16 selected rows before invalid values are removed.
  3. Choose ordinary in Group comparison method, with NaN / Inf and missing group policy on omit to discard rows without a key or a finite measurement. error stops the analysis if one of these conditions occurs. Set Output Dataset ID prefix on anova.ordinary and enable Create group-mean graph.
  4. Enable Run / recalculate now. Check the plan and use Run enabled analyses. Repeat with the method welch, prefix anova.welch and the plot off. Use the distinct IDs to open the respective results in Results.

Both methods use independent observations, with approximately normal behavior within each group for parametric inference. The classic method uses a common residual variance. Welch allows different variances and uses approximate degrees of freedom. The Welch computation needs an estimable, positive variance. Check small groups, repeated samples and dependent measurements before using the p-value.

Measurement voltage_V, factor site and classic ANOVA.
Measurement voltage_V, factor site and classic ANOVA.
Welch configuration with its own prefix.
Welch configuration with its own prefix.

Interpret the test and open the plot

The Datasets .groups give name, n, mean, standard deviation and variance. Here North has n=5 and mean 1.48 V, South n=6 and mean 2.50 V, East n=5 and mean 3.40 V. The measurement has 16 valid rows out of 18. The Datasets .test distinguish sums of squares, degrees of freedom, F statistic, p-value and the state of the effect sizes.

Method
Classic
F and degrees of freedom
33.5524 (2; 13)
p-value
7.3595×10⁻⁶
Effect sizes
η²=0.8377 and ω²=0.8027.
Method
Welch
F and degrees of freedom
31.8861 (2; 8.4358)
p-value
0.00011668
Effect sizes
State not_defined_for_welch for the classic estimators.

Under the test assumptions both outcomes give evidence against the equality of all the means. To identify the pairs responsible, appropriate follow-up comparisons are needed. η² gives the sample share of variability attributed to the factor. ω² partly corrects the sampling bias of the first indicator.

Open Plots and the plot of the means. Compare bars and labels with .groups. Use Graph → Open PNG 1:1 to read the plot at native size. The variant plot.dataset lets you save a custom title from Presentation → Title and labels… and regenerate it from Render → Rerender.

Plot of the three sites before customization.
Plot of the three sites before customization.
Plot after saving the title Tensione per sito and regenerating the variant.
Plot after saving the title Tensione per sito and regenerating the variant.
Classic test with F statistic and effect sizes.
Classic test with F statistic and effect sizes.
Welch test with approximate degrees of freedom and the state of the classic effect sizes.
Welch test with approximate degrees of freedom and the state of the classic effect sizes.