extractLL {AICcmodavg}R Documentation

Extract Log-Likelihood of Model

Description

This function extracts the log-likelihood from an object of coxme, coxph, lmekin, maxlikeFit, vglm, or various unmarkedFit classes.

Usage

extractLL(mod, ...)

## S3 method for class 'coxme'
extractLL(mod, type = "Integrated", ...)

## S3 method for class 'coxph'
extractLL(mod, ...)

## S3 method for class 'lmekin'
extractLL(mod, ...)

## S3 method for class 'maxlikeFit'
extractLL(mod, ...)

## S3 method for class 'unmarkedFit'
extractLL(mod, ...)

## S3 method for class 'vglm'
extractLL(mod, ...)

Arguments

mod

an object of coxme, coxph, lmekin, maxlikeFit, vglm, or unmarkedFit class resulting from the fit of distsamp, gdistsamp, gmultmix, multinomPois, gpcount, occu, occuRN, colext, pcount, or pcountOpen.

...

additional arguments passed to the function.

type

a character string indicating whether the integrated partial likelihood ("Integrated") or penalized likelihood ("Penalized") is to be used for a coxme object.

Details

This utility function extracts the information from a coxme, coxph, lmekin, maxlikeFit, vglm, or unmarkedFit object resulting from distsamp, gdistsamp, gmultmix, multinomPois, gpcount, occu, occuRN, colext, pcount, or pcountOpen.

Value

These functions return the value of the log-likelihood of the model and associated degrees of freedom.

Author(s)

Marc J. Mazerolle

See Also

AICc, aictab, coxme, coxph, lmekin, maxlike, distsamp, gdistsamp, occu, occuRN, colext, pcount, pcountOpen

Examples

##single-season occupancy model example modified from ?occu
## Not run: 
require(unmarked)
##single season
data(frogs)
pferUMF <- unmarkedFrameOccu(pfer.bin)
## add some fake covariates for illustration
siteCovs(pferUMF) <- data.frame(sitevar1 = rnorm(numSites(pferUMF)),
                                sitevar2 = rnorm(numSites(pferUMF))) 
     
## observation covariates are in site-major, observation-minor order
obsCovs(pferUMF) <- data.frame(obsvar1 = rnorm(numSites(pferUMF) *
                                 obsNum(pferUMF))) 

##run model set
fm1 <- occu(~ obsvar1 ~ sitevar1, pferUMF)

##extract log-likelihood
extractLL(fm1)
detach(package:unmarked)

## End(Not run)

[Package AICcmodavg version 2.3-3 Index]