# NDK_PCR_PARAM

 int __stdcall NDK_PCR_PARAM ( double ** X, size_t nXSize, size_t nXVars, LPBYTE mask, size_t nMaskLen, double * Y, size_t nYSize, double intercept, double alpha, WORD nRetType, WORD nParamIndex, double * retVal )

Calculates the regression coefficients values for a given input variable.

Returns
status code of the operation
Return values
 NDK_SUCCESS Operation successful NDK_FAILED Operation unsuccessful. See Macros for full list.
Parameters
 [in] X is the independent variables data matrix, such that each column represents one variable [in] nXSize is the number of observations (i.e. rows) in X [in] nXVars is the number of variables (i.e. columns) in X [in] mask is the boolean array to select a subset of the input variables in X. If missing (i.e. NULL), all variables in X are included. [in] nMaskLen is the number of elements in mask [in] Y is the response or the dependent variable data array (one dimensional array) [in] nYSize is the number of elements in Y [in] intercept is the constant or the intercept value to fix (e.g. zero). If missing (NaN), an intercept will not be fixed and is computed normally [in] alpha is the statistical significance of the test (i.e. alpha) [in] nRetType is a switch to select the return output: Value (default), Std. Error t-stat P-Value Upper Limit (CI) Lower Limit (CI)) [in] nParamIndex is a switch to designate the target parameter (0 = intercept (default), 1 = first variable, 2 = 2nd variable, etc.). [out] retVal is the calculated parameter value or statistics.
Remarks
1. The underlying model is described here.
2. $\mathbf{y} = \mathbf{X}\boldsymbol\beta + \boldsymbol\varepsilon$ $\hat{\boldsymbol\beta} = (\mathbf{X}^{\rm T}\mathbf{X})^{-1} \mathbf{X}^{\rm T}\mathbf{y} = \big(\, \tfrac{1}{n}{\textstyle\sum} \mathbf{x}_i \mathbf{x}^{\rm T}_i \,\big)^{-1} \big(\, \tfrac{1}{n}{\textstyle\sum} \mathbf{x}_i y_i \,\big).$ Where:
• $$\hat{\boldsymbol\beta}$$ is the estimated regression coefficients.
• The sample data may include missing values.
• Each column in the input matrix corresponds to a separate variable.
• Each row in the input matrix corresponds to an observation.
• Observations (i.e. row) with missing values in X or Y are removed.
• The number of rows of the response variable (Y) must be equal to the number of rows of the explanatory variables (X).
• The MLR_PARAM function is available starting with version 1.60 APACHE.
Requirements