The function may be called by the names: g02gkc, nag_correg_glm_constrain or nag_glm_tran_model.
g02gkc computes the estimates given a set of linear constraints for a generalized linear model which is not of full rank. It is intended for use after a call to g02gac, g02gbc, g02gcc or g02gdc.
In the case of a model not of full rank the functions use a singular value decomposition (SVD) to find the parameter estimates, , and their variance-covariance matrix. Details of the SVD are made available, in the form of the matrix :
Alternative solutions can be formed by imposing constraints on the arguments. If there are arguments and the rank of the model is , then constraints will have to be imposed to obtain a unique solution.
Let be a matrix of constraints, such that
then the new parameter estimates are given by:
where is the identity matrix, and the variance-covariance matrix is given by:
Golub G H and Van Loan C F (1996) Matrix Computations (3rd Edition) Johns Hopkins University Press, Baltimore
McCullagh P and Nelder J A (1983) Generalized Linear Models Chapman and Hall
Searle S R (1971) Linear Models Wiley
1: – IntegerInput
On entry: the number of terms in the linear model, .
2: – IntegerInput
On entry: the number of constraints to be imposed on the arguments, .
On exit: the standard error of the parameter estimates in b.
10: – doubleOutput
On exit: the upper triangular part of the variance-covariance matrix of the ip parameter estimates given in b. They are stored packed by column, i.e., the covariance between the parameter estimate given in and the parameter estimate given in , , is stored in , for and .
11: – NagError *Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).
On entry, scale must not be less than or equal to 0.0: .
It should be noted that due to rounding errors an argument that should be zero when the constraints have been imposed may be returned as a value of order machine precision.
8Parallelism and Performance
g02gkc is not threaded in any implementation.
g02gkc is intended for use in situations in which dummy (0-1) variables have been used such as in the analysis of designed experiments when you do not wish to change the arguments of the model to give a full rank model. The function is not intended for situations in which the relationships between the independent variables are only approximate.
A loglinear model is fitted to a 3 by 5 contingency table by g02gcc. The model consists of terms for rows and columns. The table is:
The constraints that the sum of row effects and the sum of column effects are zero are then read in and the parameter estimates with these constraints imposed are computed by g02gkc and printed.