MADlib
1.0 A newer version is available
User Documentation
|
SQL functions for linear regression. More...
Go to the source code of this file.
Functions | |
aggregate heteroskedasticity_test_result | heteroskedasticity_test_linregr (float8 dependentVariable, float8[] independentVariables, float8[] olsCoefficients) |
Compute studentized Breuch-Pagan heteroskedasticity test for linear regression. More... | |
aggregate linregr_result | linregr (float8 dependentVariable, float8[] independentVariables) |
Compute linear regression coefficients and diagnostic statistics. More... | |
Definition in file linear.sql_in.
aggregate heteroskedasticity_test_result heteroskedasticity_test_linregr | ( | float8 | dependentVariable, |
float8[] | independentVariables, | ||
float8[] | olsCoefficients | ||
) |
dependentVariable | Column containing the dependent variable |
independentVariables | Column containing the array of independent variables |
olsCoefficients | Column containing the array of the OLS coefficients (as obtained by linregr) |
independentVariables
array to 1.test_statistic FLOAT8[]
- Prob > test_statistcp_value FLOAT8[]
- Prob > test_statistcSELECT (heteoskedasticity_test_linregr(dependentVariable, independentVariables, coef)).* FROM ( SELECT linregr(dependentVariable, independentVariables).coef ) AS ols_coef, sourceName as src;
Definition at line 455 of file linear.sql_in.
aggregate linregr_result linregr | ( | float8 | dependentVariable, |
float8[] | independentVariables | ||
) |
dependentVariable | Column containing the dependent variable |
independentVariables | Column containing the array of independent variables |
independentVariables
array to 1.coef FLOAT8[]
- Array of coefficients, \( \boldsymbol c \)r2 FLOAT8
- Coefficient of determination, \( R^2 \)std_err FLOAT8[]
- Array of standard errors, \( \mathit{se}(c_1), \dots, \mathit{se}(c_k) \)t_stats FLOAT8[]
- Array of t-statistics, \( \boldsymbol t \)p_values FLOAT8[]
- Array of p-values, \( \boldsymbol p \)condition_no FLOAT8
- The condition number of matrix \( X^T X \).SELECT (linregr(dependentVariable, independentVariables)).* FROM sourceName;
SELECT (linregr(dependentVariable, independentVariables)).coef FROM sourceName;
SELECT (lr).coef, (lr).r2, (lr).p_values FROM ( SELECT linregr( dependentVariable, independentVariables) AS lr FROM sourceName ) AS subq;
Definition at line 508 of file linear.sql_in.