Calculates likelihood tests for fixed terms in a hierarchical generalized linear model (R.W. Payne, Y. Lee, J.A. Nelder & M. Noh).

### Options

`PRINT` = string token |
Controls printed output (`tests` ); default `test` |
---|---|

`FACTORIAL` = scalar |
Limit on number of factors in the model terms generated from the `TERMS` parameter |

`LMETHOD` = string token |
Whether to use exact likelihood or extended quasi likelihood to obtain the y-variate and weights for the dispersion model (`exact` , `eql` ); default is to use the same setting as in the original analysis |

`DMETHOD` = string token |
Method to use for the adjusted profile likelihood when calculating the likelihood statistics (`choleski` , `lrv` ); default `chol` |

`EMETHOD` = string token |
Extrapolation method to use (`aitken` , `adjustedaitken` ); default is to use the same setting as in the original analysis |

`MLAPLACEORDER` = scalar |
Order of Laplace approximation to use in the estimation of the mean model (0 or 1); default is to use the same setting as in the original analysis |

`DLAPLACEORDER` = scalar |
Order of Laplace approximation to use in the estimation of the dispersion components (0, 1 or 2); default is to use the same setting as in the original analysis |

`MAXCYCLE` = scalars |
Maximum number of iterations of the hierarchical generalized linear model fits, and maximum number of iterations in the fitting of the mean and dispersion models; default 99,50 |

`EXIT` = scalar |
Exit status (0 for success, 1 for failure to converge with any of the fixed terms) |

`TOLERANCE` = scalar |
Criterion for convergence; default is to use the same setting as in the original analysis |

`ETOLERANCE` = scalar |
Maximum size of ratio of the original to the new estimates allowed in Aitken extrapolation; default is to use the same setting as in the original analysis |

`SAVE` = pointer |
Save structure from the original analysis |

### Parameters

`TERMS` = formula |
Terms to test |
---|---|

`TESTSTATISTIC` = pointer or scalar |
Saves the test statistics |

`DF` = pointer or scalar |
Saves the degrees of freedom |

### Description

`HGFTEST`

is one of several procedures with the prefix HG, which provide tools for fitting the hierarchical and double hierarchical generalized linear models (HGLMs and DHGLMs) defined by Lee & Nelder (1996, 2001, 2006) and described by Lee, Nelder & Pawitan (2006). The models are defined by the `HGFIXEDMODEL`

, `HGRANDOMMODEL`

and `HGDRANDOMMODEL`

procedures, and fitted by the `HGANALYSE`

procedure. `HGFTEST`

lets you print or save likelihood tests for terms that can be dropped from the fixed model of a hierarchical generalized linear model.

By default, `HGFTEST`

produces tests for all the fixed terms that can be dropped: that is, for every term that is not marginal to another term in the fixed model. For example, in the formula

`A + B + C + D + A.B + A.D + B.D`

the terms `C`

, `A.B`

, `A.D`

and `B.D`

can be dropped as there are no other terms in the model that contain all their factors (i.e. none to which thay are marginal). However, `A`

cannot be dropped until `A.B`

and `A.D`

have been dropped. You can use the `TERMS`

parameter to request tests for a specific set of terms, but a missing value is given for any term that cannot be dropped. The `FACTORIAL`

option sets a limit on the number of factors in each term that is formed from the `TERMS`

formula (default 3).

The `TESTSTATISTIC`

parameter can save the statistics, and the `DF`

parameter can save their numbers of degrees of freedom. If you are making a test for a single term, you can supply a scalar for each of these parameters. However, if you have several terms, you must supply a pointer which will then be set up to contain as many scalars as there are terms.

The tests are made by calculating the change in the profile likelihood P_{v}(h) as the term concerned is dropped from the fixed model. The `LMETHOD`

, `DMETHOD`

, `EMETHOD`

, `MLAPLACEORDER`

, `DLAPLACEORDER`

, `MAXCYCLE`

, `TOLERANCE`

and `ETOLERANCE`

, options control how the fitting is done, and the likelihood is calculated. These all operate exactly as in the `HGANALYSE`

procedure. The default for `DMETHOD`

is `cholesky`

, and the default for `MAXCYCLE=`

is 99,50. For the other options the defaults are to use the same settings as in the `HGANALYSE`

command that performed the original analysis.

By default, the terms are dropped from the most recent HGLM analysis, but you can use the `SAVE`

option to supply the save structure from some earlier analysis.

Options: `PRINT`

, `FACTORIAL`

, `LMETHOD`

, `DMETHOD`

, `EMETHOD`

, `MLAPLACEORDER`

, `DLAPLACEORDER`

, `MAXCYCLE`

, `EXIT`

, `TOLERANCE`

, `ETOLERANCE`

, `SAVE`

.

Parameters: `TERMS`

, `TESTSTATISTIC`

, `DF`

.

### References

Lee, Y., & Nelder, J.A. (1996). Hierarchical generalized linear models (with discussion). *Journal of the Royal Statistical Society, Series B*, 58, 619-678.

Lee, Y., & Nelder, J.A. (2001). Hierarchical generalized linear models: a synthesis of generalised linear models, random-effect models and structured dispersions. *Biometrika*, 88, 987-1006.

Lee, Y. & Nelder, J.A. (2006). Double hierarchical generalized linear models (with discussion). *Appl. Statist.*, 55, 139-185.

Lee, Y., Nelder, J.A. & Pawitan, Y. (2006). *Generalized Linear Models with Random Effects: Unified Analysis via H-likelihood*. Chapman and Hall, Boca Raton.

### See also

Procedures: `HGANALYSE`

, `HGDISPLAY`

, `HGDRANDOMMODEL`

, `HGFIXEDMODEL`

, `HGGRAPH`

, `HGKEEP`

, `HGNONLINEAR`

, `HGPLOT`

, `HGPREDICT`

, `HGRANDOMMODEL`

, `HGRTEST`

, `HGSTATUS`

, `HGWALD`

.

Commands for: Regression analysis.

### Example

CAPTION 'HGFTEST example',!t(\ 'Breaking angles of cake baked from 3 recipes at 10 temperatures',\ '(Cochran & Cox, 1957, Experimental Designs, page 300).',\ 'Data values are assumed to follow a GLM with a gamma distribution',\ 'and reciprocal link. The linear predictor contains additional',\ 'random variables, with inverse gamma distributions and reciprocal',\ 'link, for replicates and batches of cake mixture.');\ STYLE=meta,plain FACTOR [NVALUES=270; LEVELS=3] Recipe & [LEVELS=15] Replicate & [LEVELS=!(175,185...225)] Temperature GENERATE Recipe,Replicate,Temperature VARIATE [NVALUES=270] Angle READ Angle 42 46 47 39 53 42 47 29 35 47 57 45 32 32 37 43 45 45 26 32 35 24 39 26 28 30 31 37 41 47 24 22 22 29 35 26 26 23 25 27 33 35 24 33 23 32 31 34 24 27 28 33 34 23 24 33 27 31 30 33 33 39 33 28 33 30 28 31 27 39 35 43 29 28 31 29 37 33 24 40 29 40 40 31 26 28 32 25 37 33 39 46 51 49 55 42 35 46 47 39 52 61 34 30 42 35 42 35 25 26 28 46 37 37 31 30 29 35 40 36 24 29 29 29 24 35 22 25 26 26 29 36 26 23 24 31 27 37 27 26 32 28 32 33 21 24 24 27 37 30 20 27 33 31 28 33 23 28 31 34 31 29 32 35 30 27 35 30 23 25 22 19 21 35 21 21 28 26 27 20 46 44 45 46 48 63 43 43 43 46 47 58 33 24 40 37 41 38 38 41 38 30 36 35 21 25 31 35 33 23 24 33 30 30 37 35 20 21 31 24 30 33 24 23 21 24 21 35 24 18 21 26 28 28 26 28 27 27 35 35 28 25 26 25 38 28 24 30 28 35 33 28 28 29 43 28 33 37 19 22 27 25 25 35 21 28 25 25 31 25 : FACPRODUCT !p(Replicate,Recipe); Batch HGFIXEDMODEL [DISTRIBUTION=gamma; LINK=reciprocal] Recipe*Temperature HGRANDOMMODEL [DISTRIBUTION=inversegamma; LINK=reciprocal] Replicate+Batch HGANALYSE Angle HGFTEST