Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

gammareg

Gamma regression with a log-link


Description

Gamma regression with a log-link.

Usage

gammareg(y, x, tol = 1e-07, maxiters = 100)

Arguments

y

The dependent variable, a numerical variable with non negative numbers.

x

A matrix or data.frame with the indendent variables.

tol

The tolerance value to terminate the Newton-Raphson algorithm.

maxiters

The maximum number of iterations that can take place in the regression.

Details

The gamma.reg fits a Gamma regression with a log-link. The gamma.con fits a Gamma regression with a log link with the intercept only ( glm(y ~ 1, Gamma(log) ) ).

Value

A list including:

iters

The number of iterations required by the newton-Raphson.

deviance

The deviance value.

phi

The dispersion parameter (φ) of the regression. This is necessary if you want to perform an F hypothesis test for the significance of one or more independent variables.

be

The regression coefficient(s).

Author(s)

Michail Tsagris

R implementation and documentation: Stefanos Fafalios stefanosfafalios@gmail.com and Michail Tsagris mtsagris@uoc.gr

References

McCullagh, Peter, and John A. Nelder. Generalized linear models. CRC press, USA, 2nd edition, 1989.

See Also

Examples

y <- rgamma(100, 3, 4)
x <- matrix( rnorm(100 * 2), ncol = 2)
m1 <- glm(y ~ x, family = Gamma(log) )
m2 <- gammareg(y, x)

Rfast2

A Collection of Efficient and Extremely Fast R Functions II

v0.0.9
GPL (>= 2.0)
Authors
Manos Papadakis, Michail Tsagris, Stefanos Fafalios and Marios Dimitriadis.
Initial release
2021-03-21

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.