glm {SparkR}R Documentation

Fits a generalized linear model (R-compliant).

Description

Fits a generalized linear model, similarly to R's glm().

Usage

glm(formula, family = gaussian, data, weights, subset, na.action,
  start = NULL, etastart, mustart, offset, control = list(...),
  model = TRUE, method = "glm.fit", x = FALSE, y = TRUE,
  contrasts = NULL, ...)

## S4 method for signature 'formula,ANY,SparkDataFrame'
glm(formula, family = gaussian, data,
  epsilon = 1e-06, maxit = 25)

Arguments

formula

A symbolic description of the model to be fitted. Currently only a few formula operators are supported, including '~', '.', ':', '+', and '-'.

family

A description of the error distribution and link function to be used in the model. This can be a character string naming a family function, a family function or the result of a call to a family function. Refer R family at https://stat.ethz.ch/R-manual/R-devel/library/stats/html/family.html.

data

SparkDataFrame for training.

epsilon

Positive convergence tolerance of iterations.

maxit

Integer giving the maximal number of IRLS iterations.

Value

a fitted generalized linear model

Examples

## Not run: 
##D sc <- sparkR.init()
##D sqlContext <- sparkRSQL.init(sc)
##D data(iris)
##D df <- createDataFrame(sqlContext, iris)
##D model <- glm(Sepal_Length ~ Sepal_Width, df, family="gaussian")
##D summary(model)
## End(Not run)

[Package SparkR version 2.0.0 Index]