tcensReg_sepvar: Regression Method for Truncated Normal Distribution with...

Description Usage Arguments Details Value

View source: R/tcensReg_sepvar.R

Description

This function is used to find estimates from a linear equation assuming that the data is observed from a truncated distribution with left censoring. It uses numerical values of the gradient vector and hessian matrix to solve for the maximum likelihood using maxLik package. This function can also be used with censored only, truncated only, or uncensored and untruncated gaussian models.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
tcensReg_sepvar(
  formula,
  a = -Inf,
  v = NULL,
  group_var,
  method = c("BFGS", "maxLik", "CG"),
  theta_init = NULL,
  data = sys.frame(sys.parent()),
  max_iter = 100,
  ...
)

Arguments

formula

Object of class formula which symbolically describes the model to be fit

a

Numeric scalar indicating the truncation value. Initial value is -Inf indicating no truncation

v

Numeric scalar indicating the censoring value. Initially set to NULL indicating no censoring

group_var

Character scalar indicating a variable in the data.frame that defines the independent groups

method

Character value indicating which optimization routine to perform. Choices include BFGS, maxLik and CG. See details for explanation on each method.

theta_init

Optional initial values for the parameters. Default is to fit a linear regression model.

data

Data.frame that contains the outcome and corresponding covariates. If none is provided then assumes objects are in user's environment.

max_iter

Numeric value indicating the maximum number of iterations to perform.

...

Additional arguments such as max_iter, step_max, or epsilon.

Details

Currently available optimization routines include conjugate gradient (CG), Newton-Raphson type via maxLik package (maxLik), and BFGS (BFGS). The default method is set as the conjugate gradient. Both the of the conjugate gradient and BFGS methods are implemented via the general-purpose optimization optim. These two methods use only the respective likelihood and gradient functions. The Newton-Raphson method uses the likelihood, gradient, and Hessian functions along with line search to achieve the maximum likelihood.

Value

Returns a list of final estimate of theta, total number of iterations performed, initial log-likelihood, final log-likelihood, and estimated variance covariance matrix.


tcensReg documentation built on July 8, 2020, 7:17 p.m.