Learn R Programming

micEcon (version 0.4-0)

loglikValue: Return the log likelihood value

Description

Return the log likelihood value. Objects should be models, estimated by Maksimum Likelihood, or other statistical models where the likelihood makes sense.

Usage

loglikValue(x, ...)

Arguments

x
object, usually a model estimated with Maximum Likelihood
...
additional arguments to methods

Value

  • A single numeric, log likelihood of the estimated model

Details

The default method returns the component loglik

See Also

maxLik

Examples

Run this code
## We estimate a tobit-2 model and print the loglik value
library(mvtnorm)
N <- 500
   vc <- diag(2)
   vc[2,1] <- vc[1,2] <- -0.7
   eps <- rmvnorm(N, rep(0, 2), vc)
   xs <- runif(N)
   ys <- xs + eps[,1] > 0
   xo <- runif(N)
   yo <- (xo + eps[,2])*(ys > 0)
   a <- selection(ys~xs, yo ~xo)
loglikValue(a) # this values is also printed by 'summary'

Run the code above in your browser using DataLab