Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

5.4 Regression Analysis Classes

The Analytics.h++ library provides classes for performing analyses of overall model significance for linear and logistic regressions. These classes are RWLinearRegressionANOVA, RWLogisticFitAnalysis, and RWLinearRegressionFTest. Let's discuss these in more detail in the following sections.

5.4.1 Class RWLinearRegressionANOVA

Class RWLinearRegressionANOVA may be used to conduct an analysis of variance for a linear regression. The quantities calculated include: overall F statistic, residual sum of squares, regression sum of squares, degrees of freedom for the regression and residuals, mean square error, coefficient of determination, and adjusted coefficient of determination.

Using the class is fairly easy. You simply specify a linear regression object, either at construction time or via the member function setLinearRegression(), and query the object for the various ANOVA quantities. Here is a simple example:

5.4.2 Class RWLogisticFitAnalysis

Class RWLogisticFitAnalysis is similar to class RWLinearRegression, which was described above. To use RWLogisticFitAnalysis, you specify a logistic regression, either at construction time or via the setLogisticRegression() member function, and query the object for the various fit analysis quantities. The following example demonstrates the procedure.

5.4.3 Class RWLinearRegressionFTest

Suppose that we have the linear regression model:

and we want to test the hypothesis and the hypothesis .

We can express each of these hypotheses in the matrix form , where

, , for , and

for .

The RWLinearRegressionFTest class can be used for testing hypotheses of the above form , where is the vector of parameters for the linear regression model, is a known matrix of rank , and is a known vector. The following is an example that tests both types of hypotheses.


Previous fileTop of DocumentContentsIndexNext file

©Copyright 1999, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.