SourcePro® API Reference Guide

 
List of all members | Public Member Functions
RWLogisticRegressionParam Class Reference

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)
 
RWInterval< double > confidenceInterval (double alpha) const
 
RWLogisticRegressionParamoperator= (const RWLogisticRegressionParam &rhs)
 
double standardError () const
 
double value () const
 
double waldChiSqStatCriticalValue (double alpha) const
 
double waldChiSqStatistic () const
 
double waldChiSqStatPValue () const
 

Detailed Description

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.

Synopsis
#include <rw/analytics/logregress.h>
#include <rw/analytics/logparam.h>
Example
#include <rw/analytics/logregress.h>
#include <iostream>
int main()
{
RWGenMat<double> predData = "5x2
[1 234 2 431 3 333 4 654 5 788]";
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.
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;
}

Constructor & Destructor Documentation

RWLogisticRegressionParam::RWLogisticRegressionParam ( )
inline

Constructs an empty fitted parameter object. Behavior undefined.

RWLogisticRegressionParam::RWLogisticRegressionParam ( const RWLogisticRegressionParam rhs)
inline

Constructs a copy of rhs.

Member Function Documentation

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 © 2023 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.