gammahetero1: Classic gamma regression. Log link for the mean

Description Usage Arguments Details Value Author(s) References Examples

View source: R/gammahetero1.R

Description

Performs the Classic Gamma Regression for joint modeling of mean and shape parameters.

Usage

1
gammahetero1(formula1, formula2)

Arguments

formula1

object of class formula. It describes yi and xi for the mean equation of the gamma regression.

formula2

object of class formula. It describes zi for the shape equation of the gamma regression.

Details

The classic gamma regression allow the joint modeling of mean and shape parameters of a gamma distributed variable, as is proposed in Cepeda (2001), using the Fisher Scoring algorithm, with log link for the mean and log link for the shape.

Value

object of class Gammareg with the following:

X

object of class matrix, with the variables for modelling the mean.

Z

object of class matrix, with the variables for modelling the shape.

beta

object of class matrix with the estimated coefficients of beta.

gamma

object of class matrix with the estimated coefficients of gamma.

ICB

object of class matrix with the estimated confidence intervals of beta.

ICG

object of class matrix with the estimated confidence intervals of gamma.

CovarianceMatrixbeta

object of class matrix with the estimated covariances of beta.

CovarianceMatrixgamma

object of class matrix with the estimated covariances of gamma.

AIC

the AIC criteria.

iteration

numbers of iterations to convergence.

convergence

value of convergence obtained.

Author(s)

Martha Corrales martha.corrales@usa.edu.co Edilberto Cepeda-Cuervo ecepedac@unal.edu.co

References

1. Cepeda-Cuervo, E. (2001). Modelagem da variabilidade em modelos lineares generalizados. Unpublished Ph.D. tesis. Instituto de Matem<e1>ticas. Universidade Federal do R<ed>o do Janeiro. //http://www.docentes.unal.edu.co/ecepedac/docs/MODELAGEM20DA20VARIABILIDADE.pdf. http://www.bdigital.unal.edu.co/9394/. 2. McCullagh, P. and Nelder, N.A. (1989). Generalized Linear Models. Second Edition. Chapman and Hall.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# Simulation Example

X1 <- rep(1,500)
X2 <- log(runif(500,0,30))
X3 <- log(runif(500,0,15))
X4 <- log(runif(500,10,20))
mui <- exp(-5 + 0.2*X2 - 0.03*X3)
alphai <- exp(0.2 + 0.1*X2 + 0.3*X4)
Y <- rgamma(500,shape=alphai,scale=mui/alphai)
X <- cbind(X1,X2,X3)
Z <- cbind(X1,X2,X4)
formula.mean= Y~X2+X3
formula.shape= ~X2+X4
a=gammahetero1(formula.mean,formula.shape)
a

Gammareg documentation built on July 8, 2020, 7:01 p.m.