Description
The Linear Regression function is composed of the functions Linear Regression and Linear Regression Internal. Linear Regression Internal function takes a data set and outputs a linear regression model. Linear Regression function takes the linear regression model and outputs its coefficients. One of the output model coefficient corresponds to the slope intercept. The function ignores input rows with NULL values.
Usage
td_lin_reg_mle (
formula = NULL,
data = NULL,
data.sequence.column = NULL,
data.order.column = NULL
)
Arguments
formula |
Required Argument. |
data |
Required Argument. |
data.order.column |
Optional Argument. |
data.sequence.column |
Optional Argument. |
Value
Function returns an object of class "td_lin_reg_mle" which is
a named list containing object of class "tbl_teradata".
Named list member can be referenced directly with the "$" operator
using the name: result.
Examples
# Get the current context/connection
con <- td_get_context()$connection
# Load example data.
loadExampleData("linearregression_example", "housing_data")
# Create object(s) of class "tbl_teradata".
housing_data <- tbl(con, "housing_data")
# Example 1 - This example uses the Linear Regression function
# to find the coefficients of the independent variables that
# determine the selling price of a home in a given neighborhood.
td_lin_reg_out <- td_lin_reg_mle(data = housing_data,
formula = (sellingprice ~ housesize + lotsize + bedrooms
+ granite + upgradedbathroom)
)