gammareg: Gamma regression with a log-link

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/regression_models.R

Description

Gamma regression with a log-link.

Usage

1
2
gammareg(y, x, tol = 1e-07, maxiters = 100)
gammacon(y, tol = 1e-08, maxiters =50)

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:

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).

info

The number of iterations, the deviance and the dispersion parameter.

Author(s)

Michail Tsagris

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.

References

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

See Also

gammaregs, normlog.reg, invgauss.reg

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
y <- abs( rnorm(100) )
x <- matrix( rnorm(100 * 2), ncol = 2)
mod <- glm(y ~ x, family = Gamma(log) )
res<-summary(mod)
## Not run: 
res<-gammareg(y, x)

## End(Not run)
mod <- glm(y ~ 1, family = Gamma(log) )
res<-summary(mod)
res<-gammacon(y)

Example output

Loading required package: Rcpp
Loading required package: RcppZiggurat

Rfast documentation built on Dec. 11, 2021, 9:59 a.m.