Learn R Programming

spaMM (version 2.0.0)

phiHGLM: Fitting random effects in the residual dispersion model

Description

\(\phi\) parameters are estimated by fitting a Gamma HGLM to response values computed by the parent fitting function (e.g., by HLfit in the Examples). The fitme function is used to perform this fit. The resid.model of the parent call is used to control the arguments of this fitme call.

Usage

# 'resid.model' argument of main fitting functions

Arguments

formula
model formula as in formula-only case, without left-hand side
family
The family is always Gamma. The default link is log. The identity link can be tried but may fail because only the log link ensures that the fitted \(\phi\) is positive.
fixed
fixed values of parameters. Same usage as documented in fitme
control.dist
A list of arguments that control the computation of the distance argument of the correlation functions. Same usage as documented in HLCor
rand.family
A family object or a list of family objects describing the distribution of the random effect(s). Same usage as documented for HLfit
init
Currently ignored;
method
which is constrained to be identical to the method from the parent call;
control.HLfit, control.glm
constrained to be identical to the same-named controls from the parent call;
resid.model
(constrained: no resid.model for a resid.model);
REMLformula
(constrained to NULL);
data
identical to data from the parent call, which must therefore include all the variables required for the resid.model;
prior.weights
constrained: no prior weights;
verbose
constrained: will display a progress line summarizing the results of the resid.model fit at each iteration of main loop of the parent HLfit call.

References

Lee, Y., Nelder, J. A. and Pawitan, Y. (2006) Generalized linear models with random effects: unified analysis via h-likelihood. Chapman & Hall: London.

Examples

Run this code
if (spaMM.getOption("example_maxtime")>6.1) {
 data("crack") # crack data, Lee et al. 2006 chapter 11 etc
 hlfit <- HLfit(y~crack0+(1|specimen),family=Gamma(log),
                data=crack, HLmethod="REML", 
                rand.family=inverse.Gamma(log), 
                resid.model=list(formula=~cycle+(1|specimen)) )
}

Run the code above in your browser using DataLab