
>
| Member Functions | |
| operator()() |
>#include <rw/analytics/gpvalfun.h> RWGPValueFunctor GstatPValue;
Class RWGPValueFunctor calculates the G statistic for a logistic model in comparison to the intercept only model. This value has approximately a chi-squared distribution with p degrees of freedom, where p is the number of predictor variables. The P-value of the G statistic is returned. The G statistic is described in Section 3.3.3.1 of the User's Guide.
This class may be used as the template parameter for the class RWLogRegModelSelector.
>#include <rw/analytics/lgmodsel.h>
#include <rw/analytics/logregress.h>
#include <rw/analytics/gpvalfun.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);
RWLogRegModelSelector<RWGPValueFunctor> selector( lr,
rwForwardSelection );
cout << "Searching using forward selection---------------" <<
endl;
cout << "selected parameter indices: " <<
selector.selectedParamIndices() << endl;
cout << "model criterion value: " <<
selector.evalFunctionForSelected() << endl;
return 0;
}
>
RWGPValueFunctor();
Constructs an evaluation function object.
double
operator()(const RWGenMat<double>& predictorData,
const RWMathVec<RWBoolean> obsData,
const RWMathVec<double>& calc);
Given regression data, computes the G statistic by comparing the p predictor variables in the model with the intercept only model. It returns the P-value of this statistic according to a chi-squared distribution with p degrees of freedom.
©Copyright 1999, Rogue Wave Software, Inc.
Send mail to report errors or comment on the documentation.