lognormalreg: Linear Regression of log(Y) vs. Covariates with Y Potentially...

Description Usage Arguments Value

View source: R/lognormalreg.R

Description

Uses maximum likelihood to fit Y|X ~ Lognormal(beta_0 + beta_x^T X, sigsq). 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
4
5
6
7
8
lognormalreg(
  y,
  x = NULL,
  merror = FALSE,
  estimate_var = TRUE,
  fix_posdef = FALSE,
  ...
)

Arguments

y

Numeric vector or list.

x

Numeric vector or matrix. If NULL, model reduces to marginal lognormal model Y ~ Lognormal(beta_0, sigsq).

merror

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

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


vandomed/dvmisc documentation built on Oct. 2, 2020, 9:50 p.m.