Reflections on a Career with Genstat

The blog title, "Reflections on a Career with Genstat" set across an image of Long Ashton Research Station circa 1992

Early Work with Genstat

I first met Genstat when I was an MSc student. We were given an assignment which involved fitting a non-linear curve. The software we were using (a 1980’s version of SAS) required not just the equation for the curve to be specified, but also derivatives of the non-linear parameters. Whilst I knew how to create those, it was not with any confidence.

An Australian student (Alan Lisle), who was on study leave from DPI in Queensland, introduced me to Genstat – GENSTAT IV at that time. The coding was not exactly ‘cool’, requiring directive names to be placed within quotes (‘FITCURVE’), but for non-linear fitting, it did not require derivatives nor an equation for the curve. You just had to select the required curve. So, a big relief for me!

Long Ashton Research Station (LARS), Bristol, UK

I next used Genstat after completing my MSc when I started work at Long Ashton Research Station outside Bristol (LARS). LARS was then part of the Biotechnology and Biological Sciences Research Council (BBSRC), as was Rothamsted, where Genstat development was based at that time. When I started at LARS, a new version of Genstat – Genstat 5 – had just been released. It had a revised and tidied syntax, with a key aim to be consistent, and the ‘quotes’ were no longer required.

One of the first things to get to grips with was that Genstat treated ANOVA and regression as being different beasts. Initially, my reaction was that ‘they are both linear models, so what makes them different?’ The difference soon became clear: ANOVA can include blocking simple and complex structures that are then included using least squares in a different way to the treatments. Regression can include blocking structures, but they are fitted with maximum likelihood, which gives biassed assessment of them.

I came to understand the power of the Genstat ANOVA commands: a small group of relatively simple commands that could be used to analyse a massive number of different designs, via the idea of general balance. It is still surprising that other major statistical software does not implement ANOVA using this approach.

These days, I describe things in terms of linear mixed models, recognising that ANOVA and REML are both appropriate methods but use quite different methodology. ANOVA remains relevant and important. In particular, a dummy ANOVA is very useful for checking the design structure and factors before using, for example, HGLM or REML, where the structure is not checked. Using Genstat’s ANOVA encourages understanding of complex experimental designs, especially the factors to include as block structures, because it is so straightforward to set up the commands for complex analyses.

During my time at LARS, I became part of the wider Genstat and biometrics community. I attended the Genstat Conference in Edinburgh in 1989, where I gave my first conference presentation – at high speed so the next speaker had 50% more time! I also developed my first published procedure (DESCRIBE), and met members of the Genstat team, including Roger Payne, beginning a professional relationship that has continued over many years.

Working alongside colleagues such as Phil Brain and Gillian Arnold, and being part of an international community of biometricians, played an important role in shaping how I approached statistical analysis in practice.

A photo of Long Ashton Research Station circa 1992, showing an unusually perfect field trial in the foreground.
Long Ashton Research Station circa 1992, showing an unusually perfect field trial in the foreground.

What Makes Genstat Effective in Practice

Several key aspects underpin the effectiveness of Genstat in practice:

  • The philosophy of using a small group of commands to cover the range of analyses of a particular type. For example, the same core commands (MODEL, FIT, RKEEP and so on ) can be used for general and generalized linear models making coding easier and allow consistent approaches across different problems. 
  • A strong emphasis on consistency, with the same keywords used for the same or similar functions across commands.
  • Additions to Genstat being refereed, giving confidence that the methodology is sound.

Life and Work in New Zealand

When I moved to New Zealand after around seven years at Long Ashton, a key benefit was that Crop & Food (as it then was) also used Genstat. Early on, I ‘met’ David Baird electronically, and later in person. He remains a great friend and one of a small group of biometricians I rely on for statistical or Genstat support.

At that time, David was developing a Windows version of Genstat, including menus and the spreadsheet interface. I played a small role, becoming a long-term beta tester and contributing to the Procedure Library.

Alongside this, I remained closely involved in the wider Genstat and biometrics community. I have been a member of several AASC (formerly the Genstat conference) organising and scientific committees, and chaired the 2012 conference in Queenstown. Being part of this community has been an important part of my professional life.

2012 AASC Queenstown conference organisers. Left to right: Yvonne McDiarmid, Andrew McLachlan, Chris Triggs, Duncan Hedderley, David Baird, and me.
2012 AASC Queenstown conference organisers. Left to right: Yvonne McDiarmid, Andrew McLachlan, Chris Triggs, Duncan Hedderley, David Baird, and me.

Using Genstat in Day-to-Day Analysis

There are a number of commands and features that I have found particularly valuable in day-to-day work:

  • TABLES and TABULATE for reorganising data
  • FFRAME for creating grids of graphics windows
  •  Use of colour names rather than numbers (PEN, RGB, RGBNAME)
  • IMPORT for handling a wide range of data types with a single command. You don’t even need to specify what the data-type is!
  • Functions such as TX2VAR, TVEC, WHERE, GETPOS
  • HGLM commands and DOTHISTOGRAM
  • POINTER for simplifying repeated code 
  • $[] to get elements of a data structure

More broadly, Genstat stands out because:

  • It is written and tested by statistical practitioners, so reflects real user needs
  • The underlying methodology, originally designed and developed by Prof. John Nelder and others, is reflected in the ANOVA, GLM and HGLM facilities, giving confidence that the methods are robust and trustworthy
  • The menus are comprehensive and I often use them to understand or identify the appropriate commands. 
  • It combines a flexible programming language with a relatively parsimonious approach to options and parameters
  • The Genstat Spreadsheet (SPREAD menu) is also very useful for quickly filtering and checking data (CTRL 1, CTRL 4).
  • Graphics are powerful, highly flexible and customisable. These are some of my favourites…

Dotplot: DGRAPH with XLOWER and XUPPER set
Dotplot: DGRAPH with XLOWER and XUPPER set
DOTHISTOGRAM with SELECTION option set to mean
DOTHISTOGRAM with SELECTION option set to mean
DISHADE in the forthcoming release of Genstat.
DISHADE in the forthcoming release of Genstat.

Case Study: Design and Analysis of a Tillage Trial

This example shows how Genstat can support analysis of a moderately complex experimental structure, as well as how I developed trial plans and outputs for use in consulting.

More than 25 years ago, the Crop&Food soils group wanted to set up a tillage trial. There were three tillage treatments (T1, T2, T3) plus Grass. For the tillage treatments, plots were split, with a cover crop sown on one half.

The Grass treatment created a challenge, as it would not be split and would therefore be twice as large as the other plots. To address this, Grass was treated as a pseudo cover crop on a half plot, and I introduced a fallow treatment to use on the other half effectively acting as a ‘no cover crop’..

Figure 1: Trial Plan for the Tillage Trial
Figure 1: Trial Plan for the Tillage Trial

A split plot ANOVA could be used to analyse the data, but with some additional work, the Grass/Fallow treatment could be separated from the other tillage treatments. A  small number of additional factors (GFvOther, GvF, CoverCropOth) were created, allowing more meaningful comparisons.

GFvOther: Two levels, Grass/Fallow, Other where Other was any tillage other than Grass/Fallow

GvF: Three levels, Grass, Fallow and Other for anything else

CoverCropOth: three levels, GF, No, Yes, to compare between Yes/No cover crop for the non GF tillages.

Genstat’s ANOVA easily manages the revised treatment structure. Table 1 shows dummy ANOVA tables for the two treatment structures, showing how the Tillage and CoverCrop factors were partitioned within the more complex analysis. All the various tables of means and standard errors would be correct.

Table 1: Dummy ANOVA for the two treatment structures.
Simple Treatment Structure
Tillage*CoverCrop
Structure with Grass/Fallow separated out
GFvOther/(GvF+Tillage*CoverCropOth)
Source of variation d.f. Source of variation d.f.
Block stratum 2 Block stratum 2
Block.Main stratum Block.Main stratum
Tillage 3 GFvOther 1
6 GFvOther.Tillage 2
Residual Residual 6
Block.Main.Split stratum Block.Main.Split stratum
CoverCrop 1 GFvOther.GvF 1
Tillage.CoverCrop 3 GFvOther.CoverCropOth 1
GFvOther.Tillage.CoverCropOth 2
Residual 8 Residual 8
Total 23 Total 23

Any direct comparisons between Grass or Fallow and the other tillage treatments could be made using the simple ANOVA and the various Genstat tools for comparing treatments. The trial was carried out for several years. The most interesting thing? The Fallow treatment!


Case Study: Analysing a Complex Arachnid Trial

This trial was designed by a Scientist for her PhD work and illustrates the ability of Genstat to handle highly complex experimental structures.

The aim was to compare spider assemblages (i.e., species make up) across adjacent crop types, with multiple layers of structure:

  • two site pair types: Kiwifruit/ Maize and Kiwifruit/Natives, with three site pairs of each type.
  • within each of the 12 sites, there were three transects
  • Multiple distances from crop edges. In each transect, samples were taken at 0, 5, 10, 20 and 50 meters from the crop edge.  
  • Five different trapping methods (pitfall, plus active sweep-net done at the ground and aerial each in the day and night). 
  • Repeated sampling done in January and April in each of 2023 and 2024

The resulting block and treatment structures were highly complex, involving multiple nested and crossed factors.

Figure 2: Arachnid study, Diagram of the various parts of the experimental structure. KM=Kiwifruit adjacent to Maize; KN=Kiwifruit adjacent to Native; ‘etc’ means the flow-chart is similar to the parts above. The sample times (Year and Month) have not been included, but all five were collected at each sample time at each sample location.
Figure 2: Arachnid study, Diagram of the various parts of the experimental structure. KM=Kiwifruit adjacent to Maize; KN=Kiwifruit adjacent to Native; ‘etc’ means the flow-chart is similar to the parts above. The sample times (Year and Month) have not been included, but all five were collected at each sample time at each sample location.

Despite the high complexity, Genstat’s ANOVA could manage the full structure, automatically identifying appropriate residual terms and calculating standard errors. The analysis included many treatment terms and multiple strata, yet remained tractable.

Overall, the blocking (random effects) structure has 7 layers:

Pair/Site/Transect/Distance/SampleType/Year/Month

The full treatment structure is even worse:

(TrtPair*TrtSite)*((Type/(AcDayNight*AcLevel))*Distance)*(Year*Month)

Where:

TrtPair: KN vs KM

TrtSite: Kiwi next to Native; Kiwi next to Maize, Native, Maize

Type: Pitfall vs Active

AcDayNight: Day, Night plus Pitfall (Pitfall is needed so the factor nests properly within Type)

AcLevel: Ground, Aerial, plus Pitfall

Distance: 0,5,10,20,50

Year 2023, 2024

Month: January or April

Despite the complexity of the Block and Treatment structures, Genstat’s ANOVA can manage this easily. The algorithm sorts out which Residual terms to use for each of the many treatment terms: you are not required to explicitly define them. All relevant standard errors are also calculated by default. There are over 70 lines in the ANOVA table, with 7 strata, and with the final treatment term being an interaction of eight factors… In practice this can be simplified slightly by using ‘Sample’ in place of (Type/(AcDayNight*AcLevel)) and ‘Assessment’ in place of (Year*Month). Even then, there is still a 6-factor interaction term in the treatment structure…. I’ve learned a lot from using ANOVA about experimental structure because such complex structures are fairly easy to include.

A wrinkle: At the first assessment, night sampling for one Kiwifruit-Native bush pair site was not done since the scientist felt very unsafe. This pair was replaced before the next assessment with another Kiwifruit-Native bush pair. Thus, the trial no longer had balance. However, the above block structure could be used without modification (other than omitting Month) as a formula for random effects, and the treatment structure without modification as fixed effects.

Data was analysed using HGLM or REML depending on the variable type being analysed (HGLM: counts, percentages, REML: continuous). The full random effects model was assessed only for the Total count of Spiders, since this took many hours to fit. Two random effects were found to be important: Site and Plot (15 per site: five sample positions within each transect). Further analyses only included these two random effects. With so many treatment factors, the data can only really be explored by summarising across some of those factors. Figure 3 shows four of the analysed variables, summarised over trapping types and assessments.

Figure 3: Mean total counts of four variables, summarised over trapping types and assessments. X-axis numbers show distances into the crop for the four different site types.
Figure 3: Mean total counts of four variables, summarised over trapping types and assessments. X-axis numbers show distances into the crop for the four different site types.

Even with this level of complexity, the analysis remained manageable, and the data could be explored by summarising across selected factors. This reinforced how effectively Genstat supports the analysis of complex experimental designs.

Consulting and Ongoing Use

Since 2022, I have worked as an independent consultant through my company, StatsWork 2022 Ltd. The work remains as challenging as ever, often involving complex experimental structures and data.

Genstat continues to play a central role in this work, both for analysing data and for structuring outputs in a way that is accessible and useful to others. The associated community also remains an important part of my professional life.

Picture of Dr. Ruth Butler
Dr. Ruth Butler
Dr. Ruth Butler has worked as a biometrician/statistical consultant for more than 35 years, initially in the UK, then from the mid-1990s in New Zealand. She has primarily worked with bio-protection scientists (plant pathology, entomology), but also has significant experience working with other non-medical biological scientists including in soils/agronomy, food research and plant breeding. Ruth has been a Genstat user throughout her career, contributing around 10 Genstat procedures, and has been a beta tester of Genstat for 30 years. Ruth has also been a CycDesigN user since the very first version was released in 1997. Her interests are in good data management practices, well-designed experiments, and in improving communication between statisticians and scientists.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Related articles

How much of the variation in your field trial comes from the treatments, and how much comes from...
What should you do when count data are more variable than your model expects? Vanessa Cave and David...
Precision breeding can deliver scientifically impressive traits, but practical value depends on more than technical success. Owen McIntosh...