SourcePro C++ 12.0 |
SourcePro® C++ API Reference Guide |
SourcePro C++ Documentation Home |
Container class for logistic regression parameter estimates and their associated statistical quantities. More...
#include <rw/analytics/logregparam.h>
Public Member Functions | |
RWLogisticRegressionParam () | |
RWLogisticRegressionParam (const RWLogisticRegressionParam &rhs) | |
double | standardError () const |
double | value () const |
double | waldChiSqStatistic () const |
double | waldChiSqStatPValue () const |
double | waldChiSqStatCriticalValue (double alpha) const |
RWInterval< double > | confidenceInterval (double alpha) const |
RWLogisticRegressionParam & | operator= (const RWLogisticRegressionParam &rhs) |
RWLogisticRegressionParam is the container class for logistic regression parameter estimates and their associated statistical quantities. The estimates are described in the Business Analysis Module User's Guide.
#include <rw/analytics/logregress.h> #include <rw/analytics/logparam.h> RWLogisticRegression lr; RWTValVector<RWLogisticRegressionParam> p = lr.parameterEstimates();
#include <rw/analytics/logregress.h> #include <iostream> int main() { RWGenMat<double> predData = "5x2 [1 234 2 431 3 333 4 654 5 788]"; RWMathVec<bool> obsData(5, rwUninitialized ); obsData[0] = obsData[3] = obsData[4] = true; obsData[1] = obsData[2] = false; RWLogisticRegression lr( predData, obsData ); // Make sure parameter calculation succeeded. if ( lr.fail() ) { return 0; } double sigLevel = .05; // Print out model parameter estimate info. RWTValVector<RWLogisticRegressionParam> params = lr.parameterEstimates(); for ( size_t i = 0; i < params.length(); i++ ) { std::cout << "Model parameter " << i << (i==0 ? " Intercept:" : ":") << std::endl; std::cout << " value: " << params[i].value() << std::endl; std::cout << " standard error: " << params[i].standardError() << std::endl; std::cout << " Wald statistic: " << params[i].waldChiSqStatistic() << std::endl; std::cout << " Wald statistic P-value: " << params[i].waldChiSqStatPValue() << std::endl; std::cout << " Wald statistic critical value: " << params[i].waldChiSqStatCriticalValue(sigLevel) << std::endl; std::cout << " " << sigLevel << " confidence interval: " << "[" << params[i].confidenceInterval(sigLevel).lowerBound() << ", " << params[i].confidenceInterval(sigLevel).upperBound() << "]" << std::endl; } return 0; }
RWLogisticRegressionParam::RWLogisticRegressionParam | ( | ) | [inline] |
Constructs an empty fitted parameter object. Behavior undefined.
RWLogisticRegressionParam::RWLogisticRegressionParam | ( | const RWLogisticRegressionParam & | rhs | ) | [inline] |
Constructs a copy of rhs.
RWInterval<double> RWLogisticRegressionParam::confidenceInterval | ( | double | alpha | ) | const |
Returns an alpha level confidence interval for the parameter.
RWLogisticRegressionParam& RWLogisticRegressionParam::operator= | ( | const RWLogisticRegressionParam & | rhs | ) |
Assignment operator.
double RWLogisticRegressionParam::standardError | ( | ) | const |
Returns the estimated standard error for the fitted value. This is the square root of the estimated variance, V, described in the Business Analysis Module User's Guide.
double RWLogisticRegressionParam::value | ( | ) | const [inline] |
Returns the least squares estimate for the parameter.
double RWLogisticRegressionParam::waldChiSqStatCriticalValue | ( | double | alpha | ) | const [inline] |
Returns the critical value for the Wald chi-square statistic at significance level alpha.
double RWLogisticRegressionParam::waldChiSqStatistic | ( | ) | const [inline] |
Returns the Wald chi-square statistic for the hypothesis that the parameter is equal to 0.
double RWLogisticRegressionParam::waldChiSqStatPValue | ( | ) | const [inline] |
Returns the P-value for the parameter Wald chi-square statistic.
© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.