Skip Headers

Oracle® OLAP DML Reference
10g Release 1 (10.1)

Part Number B10339-02
Go to Documentation Home
Go to Book List
Book List
Go to Table of Contents
Go to Index
Go to Master Index
Master Index
Go to Feedback page

Go to previous page
Go to next page
View PDF


The REGRESS command calculates a simple multiple linear regression. The optional WEIGHTBY keyword lets you calculate a weighted regression when some of the data points are more reliable than others.

You can then execute REGRESS.REPORT to produce a standard report of the regression. You can also use the INFO function to obtain portions of the results for use in your own customized reports or for further analysis.


To performing more complex regression analysis use a forecasting context as discussed in "Forecasting Programs".


REGRESS [NOINTERCEPT] dependent independent... [WEIGHTBY weight]



Directs Oracle OLAP to suppress the constant term (intercept) in the regression equation. The default is to calculate a constant term.


An expression to be used as the dependent variable in the regression.

In calculating the results, REGRESS loops over all the dimensions of the dependent and independent variables.


One or more expressions to be used as the independent variables (regressors) in the regression.


Specifies a weighted regression. The numeric expression weight supplies the weights for each data point (observation). Giving higher weights to more reliable observations results in a higher quality regression. WEIGHTBY must come last in the REGRESS command.

When weight is less than zero for any observation, an error occurs. When weight is equal to zero for any observation, that observation is ignored in the calculation. When WEIGHTBY is omitted, an unweighted regression is calculated.


Using a Forecasting Context

Instead of calculating a simple regression using the REGRESS command, you can perform more complex regression analysis using a forecasting context that you manipulate with the following OLAP DML statements:

  1. FCOPEN function -- Creates a forecasting context.

  2. FCSET command -- Specifies the characteristics of a forecast.

  3. FCEXEC command -- Executes a forecast and populates Oracle OLAP variables with forecasting data.

  4. FCQUERY function -- Retrieves information about the characteristics of a forecast or a trial of a forecast.

  5. FCCLOSE command -- Closes a forecasting context.

Ignoring NA Values

In performing its calculations, the REGRESS command ignores any observation that has an NA value.

Producing a Standard Report

The standard report for a regression shows the coefficient, standard error, and T-ratio for each independent variable; as well as the R-square, F-Statistic, number of observations, and standard error of estimate for the regression. To produce this report, type the following.


Obtaining Results

For information on how to obtain portions of the results of REGRESS for your own reports or further analysis, use an INFO statement.

Further Reading

For an explanation of the uses and interpretation of regression models, we suggest the latest edition of the following book:

Draper, Norman, and Smith, Harry. Applied Regression Analysis. New York: John Wiley & Sons, Inc.


Example 20-8 Simple Regression

The following statements limit the product dimension to Canoes, then use regression to investigate the influence of advertising, price, and expense on the sales of canoes.

LIMIT product TO 'Canoes'
REGRESS NOINTERCEPT sales advertising price expense

You can now execute REGRESS.REPORT as illustrated in Example 20-10, "Report for a Simple Regression" to see the results of the regression.

Example 20-9 Weighted Regression

The following statements use a weighted regression, in which districts are weighted using a variable called reliability that has the following definition and values.

DEFINE reliability VARIABLE DECIMAL <district>

-------------- -----------
Boston                1.00
Atlanta               0.90
Chicago               1.00
Dallas                0.80
Denver                0.90
Seattle               0.60

The following statements perform the regression.

REGRESS NOINTERCEPT sales advertising price expense -
WEIGHTBY reliability

You can now execute REGRESS.REPORT as illustrated in Example 20-11, "Report for a Weighted Regression" to see the results of the regression.