Regression and generalized linear models


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

PREDICT
forms predictions from a linear or generalized linear model

RFUNCTION
estimates functions of parameters of a regression model


Procedure relevant to regression analysis, in the regression and glm modules of the Library, include:


RCHECK
checks the fit of a regression model

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

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

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

SED2ESE
calculates effective standard errors that give good approximate sed's

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

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)

GEE
fits models to longitudinal data by generalized estimating equations

GLM
analyses non-standard generalized linear models

GLMM
fits 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

HGKEEP
saves information from an HGLM or DHGLM analysis

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

IFUNCTION
estimates implicit and/or explicit functions of parameters

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

RCOMPARISONS
calculates comparison contrasts amongst regression means

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

RJOINT
does modified joint regression analysis for variety-by-environment data

RLFUNCTIONAL
fits a linear functional relationship model

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

RNEGBINOMIAL
fits a negative binomial GLM estimating the aggregation parameter

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

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

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

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