AIC {PivotalR} | R Documentation

## AIC methods for Madlib regression objects

### Description

Functions to extract the AIC and log-likelihood for regression models fit in Madlib.

### Usage

        ## S3 method for class 'lm.madlib'
    extractAIC(fit, scale=0, k=2, ...)
        ## S3 method for class 'lm.madlib.grps'
    extractAIC(fit, scale=0, k=2, ...)
        ## S3 method for class 'lm.madlib'
    logLik(object, ...)
        ## S3 method for class 'lm.madlib.grps'
    logLik(object, ...)
        ## S3 method for class 'lm.madlib.grps'
    AIC(object, ..., k=2)

        ## S3 method for class 'logregr.madlib'
    extractAIC(fit, scale=0, k=2, ...)
        ## S3 method for class 'logregr.madlib.grps'
    extractAIC(fit, scale=0, k=2, ...)
        ## S3 method for class 'logregr.madlib'
    logLik(object, ...)
        ## S3 method for class 'logregr.madlib.grps'
    logLik(object, ...)
        ## S3 method for class 'logregr.madlib.grps'
    AIC(object, ..., k=2)

        ## S3 method for class 'glm.madlib'
    extractAIC(fit, scale=0, k=2, ...)

        ## S3 method for class 'glm.madlib.grps'
    extractAIC(fit, scale=0, k=2, ...)

        ## S3 method for class 'glm.madlib'
    logLik(object, ...)

        ## S3 method for class 'glm.madlib.grps'
    logLik(object, ...)

        ## S3 method for class 'glm.madlib.grps'
    AIC(object, ..., k=2)

### Arguments

`fit, object` | The regression model object, of class `lm.madlib` or `logregr.madlib`, fit using `madlib.lm` or `madlib.glm` respectively.
`scale` | The scale parameter for the model. Currently unused.
`k` | Numeric, specifying the equivalent degrees of freedom part in the AIC formula.
`...` | Other arguments, not used.

### Details

See the documentation for `AIC` and `extractAIC`.

### Value

For ungrouped regressions, `logLik` returns an object of class `logLik`, and `extractAIC` returns a length-2 numeric vector giving the edf and AIC.

For grouped regressions, `logLik` and `extractAIC` return a list giving the output of these methods for each of the component models. Similarly, `AIC` for a grouped regression returns a vector of the AICs for each of the component models.

### Author(s)

Author: Hong Ooi, Pivotal Inc.

Maintainer: Frank McQuillan, Pivotal Inc. fmcquillan@pivotal.io

### See Also

`AIC`, `extractAIC`, `logLik`.

### Examples

     ## Not run:

    ## set up the database connection
    ## Assume that .port is port number and .dbname is the database name
    cid <- db.connect(port = .port, dbname = .dbname, verbose = FALSE)

    ## create a table
    delete("abalone", conn.id = cid)
    x <- as.db.data.frame(abalone, "abalone", conn.id = cid, verbose = FALSE)

    fit <- madlib.glm(rings < 10 ~ . - id | sex, data = x, family =
    "binomial")

    AIC(fit)

    AIC(fit[[1]])

    db.disconnect(cid, verbose = FALSE)

    ## End(Not run)

[Package PivotalR version 0.1.18.3.1 Index]