SourcePro® 2023.1 |
SourcePro® API Reference Guide |
Tests that the estimated parameters in a linear regression model are equal to a hypothesized vector of values. More...
#include <rw/analytics/lrftest.h>
Public Member Functions | |
RWLinearRegressionFTest () | |
RWLinearRegressionFTest (const RWLinearRegressionFTest &t) | |
RWLinearRegressionFTest (const RWLinearRegression &lr) | |
RWLinearRegressionFTest (const RWLinearRegression &lr, const RWGenMat< double > &A, const RWMathVec< double > &c) | |
double | criticalValue (double alpha) const |
double | FStatisticPValue () const |
double | FStatisticValue () const |
RWLinearRegressionFTest & | operator= (const RWLinearRegressionFTest &ft) |
bool | reject (double alpha=.05) const |
void | setHypothesis (const RWGenMat< double > &A, const RWMathVec< double > &c) |
void | setLinearRegression (const RWLinearRegression &lr) |
Class RWLinearRegressionFTest can be used to test that the estimated parameters in a linear regression model are equal to a hypothesized vector of values. For example, it can test the hypothesis that all parameters are equal to 0. To be completely precise, the class tests the hypothesis that the estimated parameters are the solution to some specified system of linear equations. The test is based on the F statistic, described in the section "Multiple Linear Regression," in the Business Analysis Module User's Guide.
The following example creates a linear regression object and tests the hypothesis that all parameters are equal to 0 at a confidence level of 99 percent.
RWLinearRegressionFTest::RWLinearRegressionFTest | ( | ) |
Constructs an empty F test object. Behavior is undefined.
RWLinearRegressionFTest::RWLinearRegressionFTest | ( | const RWLinearRegressionFTest & | t | ) |
Constructs a copy of t.
RWLinearRegressionFTest::RWLinearRegressionFTest | ( | const RWLinearRegression & | lr | ) |
Constructs an F test for the hypothesis that \(\beta_1 = \beta_2 = ..\beta_p = 0\)
RWLinearRegressionFTest::RWLinearRegressionFTest | ( | const RWLinearRegression & | lr, |
const RWGenMat< double > & | A, | ||
const RWMathVec< double > & | c | ||
) |
Constructs an F test for the hypothesis that \(A\beta = c\)
|
inline |
Returns the critical value for the test at the significance level alpha.
|
inline |
Returns the P-value for the test.
|
inline |
Returns the value of the F statistic.
RWLinearRegressionFTest& RWLinearRegressionFTest::operator= | ( | const RWLinearRegressionFTest & | ft | ) |
Copies the contents of ft to self.
|
inline |
Returns true
if the hypothesis being tested will be rejected at the significance level alpha.
void RWLinearRegressionFTest::setHypothesis | ( | const RWGenMat< double > & | A, |
const RWMathVec< double > & | c | ||
) |
Sets the hypothesis being tested to \(A\beta = c\)
void RWLinearRegressionFTest::setLinearRegression | ( | const RWLinearRegression & | lr | ) |
Sets the linear regression for which the hypothesis will be tested.
Copyright © 2023 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |