gammareg: Constant-Scale Gamma Model for Y vs. Covariates with Y...

Description Usage Arguments Value

View source: R/gammareg.R

Description

Uses maximum likelihood to fit Y|X ~ Gamma(exp(beta_0 + beta_x^T X), b), with the shape-scale (as opposed to shape-rate) parameterization described in GammaDist. Y can be precisely measured or subject to multiplicative mean-1 lognormal errors, in which case replicates can be incorporated by specifying y as a list.

Usage

1
2
3
gammareg(y, x = NULL, merror = FALSE, integrate_tol = 1e-08,
  integrate_tol_hessian = integrate_tol, estimate_var = TRUE,
  fix_posdef = FALSE, ...)

Arguments

y

Numeric vector.

x

Numeric vector or matrix. If NULL, model reduces to marginal Gamma model Y ~ Gamma(exp(beta_0), b).

merror

Logical value for whether to model multiplicative lognormal measurement errors in Y.

integrate_tol

Numeric value specifying the tol input to hcubature. Only used if merror = TRUE.

integrate_tol_hessian

Same as integrate_tol, but for use when estimating the Hessian matrix only. Sometimes more precise integration (i.e. smaller tolerance) than used for maximizing the likelihood helps prevent cases where the inverse Hessian is not positive definite.

estimate_var

Logical value for whether to return Hessian-based variance-covariance matrix.

fix_posdef

Logical value for whether to repeatedly reduce integrate_tol_hessian by factor of 5 and re-estimate Hessian to try to avoid non-positive definite variance-covariance matrix.

...

Additional arguments to pass to nlminb.

Value

List containing:

  1. Numeric vector of parameter estimates.

  2. Variance-covariance matrix (if estimate_var = TRUE).

  3. Returned nlminb object from maximizing the log-likelihood function.

  4. Akaike information criterion (AIC).


dvmisc documentation built on Dec. 18, 2019, 1:35 a.m.