RMGLM procedure
Fits a model where different units follow different generalized linear models (R.W. Payne).
Options
Parameters
Description
RMGLM is useful if you want to fit a model where there are several generalized linear models, each one applying to a different set of data units. This is required, for example, in the fitting of hierarchical generalized linear models (see HGANALYSE), and would also allow the fitting of multivariate generalized linear models.
The NVALUES parameter can specify a list of scalars defining the number of units following each generalized linear model. If NUNITS is used, the units are assumed to be ordered so that all the units with the first generalized linear model come first, then those with the second one, and so on. The DATASET option can then save a factor to indicate which generalized linear model applies to each unit. Alternatively, you can specify a list of null settings (*) for NVALUES, and supply a pre-defined factor using the DATASET option. The DISTRIBUTION parameter specifies the error distributions, the LINK parameter specifies the link function, and the EXPONENT exponent parameter specifies the exponent where there is a power link.
The Y option specifies response variate, and the NBINOMIAL option specifies the totals for binomial data. Prior weights can be supplied using the WEIGHTS option. The TERMS option specifies the terms to be fitted, and the FULL option controls the parameterization, as in the TERMS directive. The MVINCLUDE option allows units with missing values with missing values in factors or variates in the model to be included (by default these are excluded). Where this occurs, the factor or variate is taken to make no contribution to the fitted value for the unit concerned (see TERMS for more details).
The CONSTANT option indicates whether or not to fit a constant, and the FACTORIAL option specifies a limit (default 3) on the number of variates and factors in each term, as in the FIT directive. An offset can be supplied using the OFFSET option. The LINEARPREDICTOR option can supply initial values for linear predictor, and the MAXCYCLE option can set a limit (default 30) on the number of iterations. Printed output is controlled by the PRINT option, with the same settings as in the FIT directive.
After the fit, the RDISPLAY directive can be used to generate additional output, and the RKEEP directive can be used to save information, in the usual way.
Options: PRINT, Y, TERMS, NBINOMIAL, DISPERSION, WEIGHTS, OFFSET, CONSTANT, FACTORIAL, FULL, DATASET, LINEARPREDICTOR, MAXCYCLE, MVINCLUDE, SAVE.
Parameter: NVALUES, DISTRIBUTION, LINK, EXPONENT.
Method
RMGLM uses the calculated settings of the DISTRIBUTION and LINK options
of MODEL.
Action with
RESTRICT
You can restrict the units that GenStat will use for the fit by putting a restriction on the response variates, weight variate, offset variate, binomial totals, or any explanatory variate or factor. However, you must then supply the initial values for linear predictor (using the LINEARPREDICTOR option), as the default calculation requires use of RESTRICT.