remlscorgamma: Approximate REML for Gamma Regression with Structured...

remlscoregammaR Documentation

Approximate REML for Gamma Regression with Structured Dispersion

Description

Estimates structured dispersion effects using approximate REML with gamma responses.

Usage

remlscoregamma(y, X, Z, mlink="log", dlink="log", trace=FALSE, tol=1e-5, maxit=40)

Arguments

y

numeric vector of responses.

X

design matrix for predicting the mean.

Z

design matrix for predicting the variance.

mlink

character string or numeric value specifying link for mean model.

dlink

character string or numeric value specifying link for dispersion model.

trace

logical value. If TRUE then diagnostic information is output at each iteration.

tol

convergence tolerance.

maxit

maximum number of iterations allowed.

Details

This function fits a double generalized linear model (glm) with gamma responses. As for ordinary gamma glms, a link-linear model is assumed for the expected values. The double glm assumes a separate link-linear model for the dispersions as well. The responses y are assumed to follow a gamma generalized linear model with link mlink and design matrix X. The dispersions follow a link-linear model with link dlink and design matrix Z.

Write y_i for the ith response. The y_i are assumed to be independent and gamma distributed with E(y_i) = μ_i and var(y_i)=φ_iμ_i^2. The link-linear model for the means can be written as

g(μ)=Xβ

where g is the mean-link function defined by mlink and μ is the vector of means. The dispersion link-linear model can be written as

h(φ)=Zγ

where h is the dispersion-link function defined by dlink and φ is the vector of dispersions.

The parameters γ are estimated by approximate REML likelihood using an adaption of the algorithm described by Smyth (2002). See also Smyth and Verbyla (1999a,b) and Smyth and Verbyla (2009). Having estimated γ and φ, the β are estimated as usual for a gamma glm.

The estimated values for β, μ, γ and φ are return as beta, mu, gamma and phi respectively.

Value

List with the following components:

beta

numeric vector of regression coefficients for predicting the mean.

se.beta

numeric vector of standard errors for beta.

gamma

numeric vector of regression coefficients for predicting the variance.

se.gam

numeric vector of standard errors for gamma.

mu

numeric vector of estimated means.

phi

numeric vector of estimated dispersions.

deviance

minus twice the REML log-likelihood.

h

numeric vector of leverages.

References

Smyth, G. K., and Verbyla, A. P. (1999a). Adjusted likelihood methods for modelling dispersion in generalized linear models. Environmetrics 10, 695-709. http://www.statsci.org/smyth/pubs/ties98tr.html

Smyth, G. K., and Verbyla, A. P. (1999b). Double generalized linear models: approximate REML and diagnostics. In Statistical Modelling: Proceedings of the 14th International Workshop on Statistical Modelling, Graz, Austria, July 19-23, 1999, H. Friedl, A. Berghold, G. Kauermann (eds.), Technical University, Graz, Austria, pages 66-80. http://www.statsci.org/smyth/pubs/iwsm99-Preprint.pdf

Smyth, G. K. (2002). An efficient algorithm for REML in heteroscedastic regression. Journal of Computational and Graphical Statistics 11, 836-847.

Smyth, GK, and Verbyla, AP (2009). Leverage adjustments for dispersion modelling in generalized nonlinear models. Australian and New Zealand Journal of Statistics 51, 433-448.

Examples

data(welding)
attach(welding)
y <- Strength
X <- cbind(1,(Drying+1)/2,(Material+1)/2)
colnames(X) <- c("1","B","C")
Z <- cbind(1,(Material+1)/2,(Method+1)/2,(Preheating+1)/2)
colnames(Z) <- c("1","C","H","I")
out <- remlscoregamma(y,X,Z)

statmod documentation built on Jan. 6, 2023, 5:14 p.m.