Description
The generalized linear model (GLM) is an extension of the linear regression model that enables the linear equation to be related to the dependent variables by a link function. GLM performs linear regression analysis for distribution functions using a user-specified distribution family and link function. GLM selects the link function based upon the distribution family and the assumed nonlinear distribution of expected outcomes. The table in background describes the supported link function combinations.
Usage
td_glm_mle ( formula = NULL, family = "gaussian", linkfunction = "CANONICAL", data = NULL, weights = "1.0", threshold = 0.01, maxit = 25, step = FALSE, intercept = TRUE, data.sequence.column = NULL )
Arguments
formula |
Required Argument. |
family |
Optional Argument. |
linkfunction |
Optional Argument. |
data |
Required Argument. |
weights |
Optional Argument. |
threshold |
Optional Argument. |
maxit |
Optional Argument. |
step |
Optional Argument. |
intercept |
Optional Argument. |
data.sequence.column |
Optional Argument. |
Value
Function returns an object of class "td_glm_mle" which is a named list
containing Teradata tbl objects.
Named list members can be referenced directly with the "$" operator
using following names:
coefficients
output
Examples
# Get the current context/connection con <- td_get_context()$connection # Load example data. loadExampleData("glm_example", "admissions_train", "housing_train") # Create remote tibble objects. admissions_train <- tbl(con, "admissions_train") housing_train <- tbl(con, "housing_train") # Example 1 - td_glm_out1 <- td_glm_mle(formula = (admitted ~ stats + masters + gpa + programming), family = "LOGISTIC", linkfunction = "LOGIT", data = admissions_train, weights = "1", threshold = 0.01, maxit = 25, step = FALSE, intercept = TRUE ) # Example 2 - td_glm_out2 <- td_glm_mle(formula = (admitted ~ stats + masters + gpa + programming), family = "LOGISTIC", linkfunction = "LOGIT", data = admissions_train, weights = "1", threshold = 0.01, maxit = 25, step = TRUE, intercept = TRUE ) # Example 3 - td_glm_out3 <- td_glm_mle(formula = (price ~ recroom + lotsize + stories + garagepl + gashw + bedrooms + driveway + airco + homestyle + bathrms + fullbase + prefarea), family = "GAUSSIAN", linkfunction = "IDENTITY", data = housing_train, weights = "1", threshold = 0.01, maxit = 25, step = FALSE, intercept = TRUE )