>
Member Functions | |||
confidenceInterval() operator=() |
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.
>#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<RWBoolean> 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.
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 1999, Rogue Wave Software, Inc.
Send mail to report errors or comment on the documentation.