2.1.11.17 ocmath_partial_reg_plots


Description

Function to compute the data for partial regression plot

Syntax

int ocmath_partial_reg_plots( const double * pX, UINT nOSizeN, UINT nVSizeM, const double * pY, const LROptions * psLROptions, double * pPlotMat, uint nMPlotMat )

Parameters

pX
[input] matrix containing data points of the independent variables
nOSizeN
[input] the number of observations, n. n>=2
nVSizeM
[input] the total number of independent variables in the data set, m. m>=1
pY
[input] pointer data points of dependent variable, size of pY = nOSizeN
psLROptions
[input] pointer to structure for linear regression options
pPlotMat
[output] pointer to data for partial regression plot,
in the pPlotMat, the 2k-1th column indicates the x axis values and 2k column
indicates the y axis of partial regression plot of the nth parameter. Row size of
pPlotMat should be nOSizeN;
nMPlotMat
[input] column size of pPlotMat;

Return

Examples

EX1

void mr_plot()
{
    Matrix mat1("MBook1");
    matrix mX = mat1;
    Dataset dsY("Book1_A");
    vector vY = dsY;
    int nVSizeM = mX.GetNumCols();
    int nOSizeN = mX.GetNumRows();
    LROptions sLROptions;
    sLROptions.FixIntercept = false;
    matrix mPlot;
    int nFitSize = sLROptions.FixIntercept ? nVSizeM : nVSizeM + 1;
    mPlot.SetSize(nOSizeN, 2*nFitSize);
    int nRet = ocmath_partial_reg_plots(mX, nOSizeN, nVSizeM, vY, &sLROptions, mPlot, 2*nFitSize);    
    Matrix mat2("MBook2");
    mat2 = mPlot;            
}

Remark

See Also

Header to Include

origin.h

Reference