Learn R Programming

UPG (version 0.3.4)

logLik.UPG.MNL: Compute log-likelihoods from UPG.MNL objects

Description

logLik can be used to compute log-likelihoods from UPG.MNL objects. The log-likelihood is based on the posterior mean of the coefficients.

Usage

# S3 method for UPG.MNL
logLik(object = NULL, ...)

Value

Returns a numeric of class logLik with attributes containing the number of estimated parameters and the number of observations.

Arguments

object

an object of class UPG.MNL.

...

other logLik parameters.

Author

Gregor Zens

See Also

summary.UPG.MNL to summarize a UPG.MNL object and create tables. plot.UPG.MNL to plot a UPG.MNL object. coef.UPG.MNL to extract coefficients from a UPG.MNL object.

Examples

Run this code
# \donttest{
# estimate a multinomial logit model using example data
library(UPG)
data(program)
y = program[,1]
X = program[,-1]
results.mnl = UPG(y = y, X = X, model = "mnl")

# extract log-likelihood
ll.mnl = logLik(results.mnl)

# }

Run the code above in your browser using DataLab