logLik-methods | R Documentation |
logLik
for Two-part Model Objects in Package twopartmThe logLik
method for twopartm-class
that extracts log-likelihood from a fitted two-part regression model object of class twopartm
.
## S4 method for signature 'twopartm' logLik(object,...)
object |
a fitted two-part model object of class |
... |
arguments passed to |
The logLik
method for twopartm-class
returns an object of class logLik
, including the log likelihood value with degree of freedom of a fitted two-part regression model object of class twopartm
.
Returns an object of class logLik
for model object twopartm
.This is a number with at least one attribute, "df" (degrees of freedom), giving the number of (estimated) parameters in the two-part model.
Yajie Duan, Birol Emir, Griffith Bell and Javier Cabrera
Belotti, F., Deb, P., Manning, W.G. and Norton, E.C. (2015). twopm: Two-part models. The Stata Journal, 15(1), pp.3-20.
Harville, D.A. (1974). Bayesian inference for variance components using only error contrasts. Biometrika, 61, 383–385. doi: 10.2307/2334370.
twopartm-class
, glm
,logLik.lm
, tpm
##data about health expenditures, i.e., non-negative continuous response data(meps,package = "twopartm") ##fit two-part model with the same regressors in both parts, with logistic ##regression model for the first part, and glm with Gamma family with log ##link for the second-part model tpmodel = tpm(exp_tot~female+age, data = meps,link_part1 = "logit", family_part2 = Gamma(link = "log")) tpmodel ##summary information summary(tpmodel) ##log-likehood logLik(tpmodel)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.