extractLL: Extract Log-Likelihood of Model

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/extractLL.R

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
##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)

AICcmodavg documentation built on June 20, 2017, 9:04 a.m.

Search within the AICcmodavg package
Search all R packages, documentation and source code