residuals {PivotalR} | R Documentation

## Residuals methods for Madlib regression objects

### Description

Functions to extract the residuals for regression models fit in Madlib.

### Usage

    ## S3 method for class 'lm.madlib'
    residuals(object, ...)

    ## S3 method for class 'lm.madlib.grps'
    residuals(object, ...)

    ## S3 method for class 'logregr.madlib'
    residuals(object, ...)

    ## S3 method for class 'logregr.madlib.grps'
    residuals(object, ...)

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

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

### Arguments

`object` | The regression model object, of class `lm.madlib`, `lm.madlib.grps` or `logregr.madlib`, `logregr.madlib.grps` obtained using `madlib.lm` or `madlib.glm` respectively.
`...` | Other arguments, not used.

### Details

See the documentation for `residuals`

### Value

For ungrouped regressions, `residuals` returns an object of class `db.Rquery`

For grouped regressions, `residuals` returns a list of `db.Rquery` objects 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: Predictive Analytics Team, 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)

    x <- as.db.data.frame(abalone, conn.id = cid, verbose = FALSE)
    lk(x, 10)

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

    residuals(fit)

    db.disconnect(cid)

    ## End(Not run)

[Package PivotalR version 0.1.18.3.1 Index]