Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

loglikelihood

Negative 2 log likelihood


Description

Calculate the -2 * log likelihood of a dataset given a specified model.

Usage

loglikelihood(b, dataset)

Arguments

b

intercept and coefficients of a generalized linear model.

dataset

a test dataset used to derive the likelihood.

Value

the function returns the -2 * log likelihood.

Examples

## Using the mtcars dataset
## Resample, fit an ordinary least squares model and calculate likelihood
data(mtcars)
mtc.data <- cbind(1,datashape(mtcars, y = 8, x = c(1, 6, 9)))
head(mtc.data)
mtc.boot <- randboot(mtc.data, replace = TRUE)
boot.betas <- ml.rgr(mtc.boot)
loglikelihood(b = boot.betas, dataset = mtc.data)

apricom

Tools for the a Priori Comparison of Regression Modelling Strategies

v1.0.0
GPL-2
Authors
Romin Pajouheshnia [aut, cre], Wiebe Pestman [aut], Rolf Groenwold [aut]
Initial release
2015-11-11

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.