Learn R Programming

PivotalR (version 0.1.18.5)

residuals: Residuals methods for Madlib regression objects

Description

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

Usage

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

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

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

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

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

# S3 method for 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.

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.

Details

See the documentation for residuals

See Also

AIC, extractAIC, logLik.

Examples

Run this code
# NOT RUN {
 
# }
# NOT RUN {
<!-- %% @test .port Database port number -->
<!-- %% @test .dbname Database name -->
## 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)
# }

Run the code above in your browser using DataLab