olsEx#

swordfish.function.olsEx()#

Return the result of an ordinary-least-squares regression of Y on X. Y and X are columns in a partitioned table.

Note that null values in X and Y are treated as 0 in calculations.

Parameters:
  • ds (Constant) – A set of data sources stored in a tuple. It is usually generated by the function sqlDS.

  • Y (Constant) – A string indicating the column name of the dependent variable from the table represented by ds.

  • X (Constant) – A string scalar/vector indicating the column name(s) of independent variable(s) from the table represented by ds.

  • intercept (Constant, optional) – A boolean variable indicating whether the regression includes the intercept. If it is true, the system automatically adds a column of 1’s to X to generate the intercept. The default value is true.

  • mode (Constant, optional) –

    An integer that could be 0,1,2. It indicates the contents in the output. The default value is 0.

    • 0: a vector of the coefficient estimates

    • 1: a table with coefficient estimates, standard error, t-statistics, and p-value

    • 2: a dictionary with all statistics