Genstat provides directives for carrying out linear and nonlinear regression, also generalized linear, generalized additive and generalized nonlinear models. They are designed to allow easy comparison between models, and comparison between groups of data (specified as factors). The directives for nonlinear regression can also be used for general optimization. There are three preliminary directives for defining the form of model to be fitted, of which the `MODEL`

directive must always be given first:

`MODEL` |
defines the response variate(s) and the type of model to be fitted |
---|---|

`TERMS` |
specifies a maximal model, containing all terms to be used in subsequent regression models |

`RCYCLE` |
controls iterative fitting of generalized linear models, generalized additive models and nonlinear models, and specifies parameters and bounds for nonlinear models |

Separate directives carry out the fitting of the various types of model:

`FIT` |
fits a linear model, a generalized linear model, a generalized additive model, or a generalized nonlinear model |
---|---|

`FITCURVE` |
fits a standard nonlinear regression model |

`FITNONLINEAR` |
fits a user-defined nonlinear regression model or optimizes a scalar function |

Further directives are provided to allow sequential modification of the set of explanatory variables:

`ADD` |
adds extra terms to any type of regression model |
---|---|

`DROP` |
drops terms from any type of regression model |

`SWITCH` |
adds terms to, or drops them from, any type of regression model |

`TRY` |
displays results of single-term changes to a linear or generalized linear model |

`STEP` |
selects terms to include in or exclude from a linear or generalized linear model |

The results of fitting the models can be displayed or stored in data structures:

`RDISPLAY` |
displays the fit of any type of regression model |
---|---|

`RKEEP` |
stores the results from any type of regression model |

`RKESTIMATES` |
saves estimates and other information about individual terms in a regression analysis |

`PREDICT` |
forms predictions from a linear or generalized linear model |

`RFUNCTION` |
estimates functions of parameters of a regression model |

`RSPREADSHEET` |
puts results from a regression, generalized linear or nonlinear model into Genstat spreadsheets |

Procedure in the Library relevant to regression analysis include:

`RCHECK` |
checks the fit of a regression model |
---|---|

`RGRAPH` |
draws a graph to display the fit of a regression model |

`RDESTIMATES` |
plots one- or two-way tables of regression estimates |

`RPERMTEST` |
does random permutation and exact tests for regression or generalized-linear-model analyses |

`RPOWER` |
calculates the power (probability of detection) for regression models |

`RCOMPARISONS` |
calculates comparison contrasts amongst the levels of a factor classifying a table of regression means |

`RRETRIEVE` |
retrieves a regression save structure from an external file |

`RSTORE` |
stores a regression save structure in an external file |

`RTCOMPARISONS` |
calculates comparison contrasts within a multi-way table of means |

`RWALD` |
calculates Wald and F tests for dropping terms from a regression |

`RYPARALLEL` |
fits the same regression model to several response variates, and collates the output |

`SED2ESE` |
calculates effective standard errors that give good approximate sed’s |

`SEDLSI` |
calculates least significant intervals |

`LSIPLOT` |
plots least significant intervals |

`MCOMPARISON` |
performs pairwise multiple comparison tests within a table of predictions |

`BRDISPLAY` |
displays a regression tree |

`BREGRESSION` |
constructs a regression tree |

`BRPREDICT` |
makes predictions using a regression tree |

`BRVALUES` |
forms values for nodes of a regression tree |

`DILUTION` |
calculates Most Probable Numbers from dilution series data |

`DSEPARATIONPLOT` |
creates a separation plot for visualising the fit of a model with a dichotomous (i.e. binary) or polytomous (i.e. multi-categorical) outcome |

`EXTRABINOMIAL` |
fits models to overdispersed proportions |

`FIELLER` |
calculates effective doses or relative potencies |

`FITINDIVIDUALLY` |
fits regression models one term at a time (useful for obtaining an accumulated analysis of deviance table containing the contributions of individual terms in a generalized linear model) |

`FITMULTINOMIAL` |
fits generalized linear models with multinomial distribution |

`GEE` |
fits models to longitudinal data by generalized estimating equations |

`GLM` |
analyses non-standard generalized linear models |

`GLMM` |
fits a generalized linear mixed model |

`GLDISPLAY` |
displays further output from a `GLMM` analysis |

`GLKEEP` |
saves results from a `GLMM` analysis |

`GLPERMTEST` |
does random permutation tests for generalized linear mixed models. |

`GLPLOT` |
plots residuals from a `GLMM` analysis |

`GLPREDICT` |
forms predictions from a `GLMM` analysis |

`GLRTEST` |
calculates likelihood tests to assess random terms in a generalized linear mixed model |

`HGANALYSE` |
analyses data using a hierarchical generalized linear model (HGLM) or a double hierarchical generalized linear model (DHGLM) |

`HGDISPLAY` |
displays results from an HGLM or DHGLM |

`HGDRANDOMMODEL` |
adds random terms into the dispersion models of an HGLM, so that the whole model becomes a DHGLM |

`HGFIXEDMODEL` |
defines the fixed model for an HGLM or DHGLM |

`HGFTEST` |
calculates likelihood tests for fixed terms in a hierarchical generalized linear model |

`HGGRAPH` |
draws a graph to display the fit of an HGLM or DHGLM analysis |

`HGKEEP` |
saves information from an HGLM or DHGLM analysis |

`HGNONLINEAR` |
defines nonlinear parameters for the fixed model of an HGLM |

`HGPLOT` |
produces model-checking plots for an HGLM or DHGLM |

`HGPREDICT` |
forms predictions from an HGLM or DHGLM analysis |

`HGRANDOMMODEL` |
defines the random model for an HGLM |

`HGRTEST` |
calculates likelihood tests for random terms in a hierarchical generalized linear model |

`HGSTATUS` |
displays the current HGLM model definitions |

`HGWALD` |
prints or saves Wald tests for fixed terms in an HGLM |

`IFUNCTION` |
estimates implicit and/or explicit functions of parameters |

`MAREGRESSION` |
does regressions for single-channel microarray data |

`MINIMIZE` |
finds the minimum of a function calculated by a procedure |

`MIN1DIMENSION` |
finds the minimum of a function in one dimension |

`MICHAELISMENTEN` |
fits the Michaelis-Menten equation for substrate concentration versus time data |

`MMPREDICT` |
predicts the Michaelis-Menten curve for a particular set of parameter values |

`NLAR1` |
fits curves with an AR1 or a power-distance correlation model |

`PAIRTEST` |
performs t-tests for pairwise differences |

`PPAIR` |
displays results of t-tests for pairwise differences in compact diagrams |

`PROBITANALYSIS` |
fits probit models allowing for natural mortality and immunity |

`R0INFLATED` |
fits zero-inflated regression models to count data with excess zeros |

`R0KEEP` |
saves information from models fitted by `R0INFLATED` |

`RAR1` |
fits regressions with an AR1 or a power-distance correlation model |

`RBRADLEYTERRY` |
fits the Bradley-Terry model for paired-comparison preference tests |

`RCATENELSON` |
performs a Cate-Nelson graphical analysis of bivariate data |

`RCIRCULAR` |
does circular regression of mean direction for an angular response |

`RFINLAYWILKINSON` |
performs Finlay and Wilkinson’s joint regression analysis of genotype-by-environment data |

`RIDGE` |
produces ridge regression and principal component regression analyses |

`LRIDGE` |
does logistic ridge regression |

`RLASSO` |
performs lasso using iteratively reweighted least-squares |

`RQLINEAR` |
fits and plots quantile regressions for linear models |

`RQNONLINEAR` |
fits and plots quantile regressions for nonlinear models |

`RQSMOOTH` |
fits and plots quantile regressions for loess or spline models |

`RLFUNCTIONAL` |
fits a linear functional relationship model |

`RMGLM` |
fits a model where different units follow different generalized linear models |

`RNEGBINOMIAL` |
fits a negative binomial generalized linear model estimating the aggregation parameter |

`RNONNEGATIVE` |
fits a generalized linear model with nonnegativity constraints (synonym `FITNONNEGATIVE` ) |

`RPAIR` |
gives t-tests for all pairwise differences of means from linear or generalized linear models |

`RPARALLEL` |
carries out analysis of parallelism for nonlinear functions (synonym `FITPARALLEL` ) |

`RQUADRATIC` |
fits a quadratic surface and estimates its stationary point |

`RSCHNUTE` |
fits a general four-parameter growth model to a non-decreasing response variate (synonym `FITSCHNUTE` ) |

`RSCREEN` |
performs screening tests for generalized or multivariate linear models |

`RSEARCH` |
searches through models for a regression or generalized linear model (with methods including all-subsets, forward and backward stepwise regression) |

`R2LINES` |
fits two-straight-line (broken-stick) models to data |

`SIMPLEX` |
searches for the minimum of a function using the Nelder-Mead algorithm |

`SVGLM` |
fits generalized linear models to survey data |

`WADLEY` |
fits models for Wadley’s problem, allowing alternative links and errors |

`XOCATEGORIES` |
performs analyses of categorical data from crossover trials |

`YTRANSFORM` |
estimates the parameter lambda of a single parameter transformation |