# remlscoregamma

##### Approximate REML for gamma regression with structured dispersion

Estimates structured dispersion effects using approximate REML with gamma responses.

- Keywords
- regression

##### 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 variable. If true then output diagnostic information at each iteration.
- tol
- Convergence tolerance
- maxit
- Maximum number of iterations allowed

##### Details

Write $\mu_i=E(y_i)$ for the expectation of the $i$th response and $s_i=\var(y_i)$.
We assume the heteroscedastic regression model
$$\mu_i=\bold{x}_i^T\bold{\beta}$$
$$\log(\sigma^2_i)=\bold{z}_i^T\bold{\gamma},$$
where $**x**_i$ and $**z**_i$ are vectors of covariates, and $**\beta**$ and $**\gamma**$ are vectors of regression coefficients affecting the mean and variance respectively.
Parameters are estimated by maximizing the REML likelihood using REML scoring as described in Smyth and Verbyla (2001).
See also Smyth and Verbyla (1999a,b).

##### Value

- List with the following components:
beta Vector of regression coefficients for predicting the mean se.beta gamma Vector of regression coefficients for predicting the variance se.gam Standard errors for gamma mu Estimated means phi Estimated dispersions deviance Minus twice the REML log-likelihood h Leverages

##### References

Smyth, G. K., and Verbyla, A. P. (1999a). Adjusted likelihood methods for modelling dispersion in generalized linear models. *Environmetrics* 10, 695-709.
*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.

##### 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)
```

*Documentation reproduced from package statmod, version 1.3.8, License: LGPL (>= 2)*