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

1 | ```
loglikelihood(b, dataset)
``` |

`b` |
intercept and coefficients of a generalized linear model. |

`dataset` |
a test dataset used to derive the likelihood. |

the function returns the -2 * log likelihood.

1 2 3 4 5 6 7 8 | ```
## 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)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.