AIC {PivotalR} | R Documentation |
Functions to extract the AIC and log-likelihood for regression models fit in Madlib.
## 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)
fit, object |
The regression model object, of class |
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. |
See the documentation for AIC
and extractAIC
.
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: Hong Ooi, Pivotal Inc.
Maintainer: Frank McQuillan, Pivotal Inc. fmcquillan@pivotal.io
AIC
, extractAIC
, logLik
.
## 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)