TD_LINEAR_REGR Function | Teradata Vantage - TD_LINEAR_REGR - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
ft:locale
en-US
ft:lastEdition
2024-12-11
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

TD_LINEAR_REGR is a simple linear regression function. It fits data to a curve using a formula that defines the relationship between the explanatory variable and the response variable.

Simple linear regression has many applications such as the following:

  • Marketing: Predict sales based on the amount of money spent on advertising. The company can determine the most effective advertising strategy to increase sales.
  • Economics: Analyze the relationship between variables such as inflation and interest rates, or unemployment rates and GDP. Economists can make predictions about the future of the economy.
  • Medicine: Analyze the relationship between a patient's age and a particular disease. Doctors can better predict the likelihood of a patient developing a certain disease and recommend preventative measures.
  • Education: Analyze the relationship between a student's study time and their grades. Teachers can identify which students need additional support and resources to improve their academic performance.
  • Sports: Analyze the relationship between an athlete's performance and their physical attributes such as height or weight. Coaches can optimize their team's performance by selecting players with the optimal physical attributes.
  • Finance: Analyze the relationship between a company's stock price and various financial metrics such as revenue or earnings. Investors can make informed decisions about whether to buy, hold, or sell a particular stock.
The following procedure is an example of how to use TD_LINEAR_REGR to develop a simple regression model. The goal is to create a regression model showing the relationship between, HousePrice (response variable) and Salary (explanatory variable).
  1. Use TD_LINEAR_REGR to curve-fit sample data (HousePrice, Salary) to the FORMULA Y = B1*X1 + Constant, where Y is HousePrice and X1 is Salary.
  2. Use TD_EXTRACT_RESULTS generate an ART table containing the ARTFITMETADATA layer and ARTFITRESIDUAL layer to retrieve goodness-of-fit measures and the residual data after model-fitting, respectively.
  3. Use TD_GENSERIES4FORMULA with new Salary data points to predict the price of the house that the applicant can purchase.