Description Usage Arguments Details Value
View source: R/tcensReg_sepvar.R
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.
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,
...
)
|
formula |
Object of class |
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 |
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 |
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.
Returns a list of final estimate of theta, total number of iterations performed, initial log-likelihood, final log-likelihood, and estimated variance covariance matrix.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.