Does not inherit
confidenceInterval() operator=() |
RWLogisticRegressionParam() standardError() |
value() waldChiSqStatCriticalValue() |
waldChiSqStatistic() waldChiSqStatPvalue() |
#include <rw/analytics/logregress.h> #include <rw/analytics/logparam.h> RWLogisticRegression lr; RWTValVector<RWLogisticRegressionParam> p = lr.parameterEstimates();
RWLogisticRegressionParam is the container class for logistic regression parameter estimates and their associated statistical quantities. The estimates are described in Section 3.2.4, "Significance of the Model (Overall F Statistic)," in the Business Analysis Module User's Guide.
#include <rw/analytics/logregress.h> #include <rw/rstream.h> 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++ ) { cout << "Model parameter " << i << (i==0UL?" Intercept:":":") << endl; cout << " value: " << params[i].value() << endl; cout << " standard error: " << params[i].standardError() << endl; cout << " Wald statistic: " << params[i].waldChiSqStatistic() << endl; cout << " Wald statistic P-value: " << params[i].waldChiSqStatPValue() << endl; cout << " Wald statistic critical value: " << params[i].waldChiSqStatCriticalValue(sigLevel) << endl; cout << " " << sigLevel << " confidence interval: " << "[" << params[i].confidenceInterval(sigLevel).lowerBound() << ", " << params[i].confidenceInterval(sigLevel).upperBound() << "]\n" << endl; } return 0; }
RWLogisticRegressionParam();
Constructs an empty fitted parameter object. Behavior undefined.
RWLogisticRegressionParam(const RWLogisticRegressionParam& a);
Constructs a copy of a.
RWInterval<double> confidenceInterval(double alpha) const;
Returns an alpha level confidence interval for the parameter.
double standardError() const;
Returns the estimated standard error for the fitted value. This is the square root of the estimated variance, V, described in Section 3.3.2, "Parameter Variances and Covariances" in the Business Analysis Module User's Guide.
double waldChiSqStatCriticalValue(double alpha) const;
Returns the critical value for the Wald chi-square statistic at significance level alpha.
double waldChiSqStatistic() const;
Returns the Wald chi-square statistic for the hypothesis that the parameter is equal to 0.
double waldChiSqStatPvalue() const;
Returns the P-value for the parameter Wald chi-square statistic.
double value() const;
Returns the least squares estimate for the parameter.
RWLogisticRegressionParam& operator=(const RWLogisticRegressionParam&);
Assignment operator.
© 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.