SLR_PARAM - Simple Regression Coefficients Values

Calculates the OLS regression coefficient values.


SLR_PARAM (X, Y, Intercept, Return, Parameter Index, Alpha)
is the independent (aka explanatory or predictor) variable data array (a one-dimensional array of cells (e.g., rows or columns)).
is the response or the dependent variable data array (a one-dimensional array of cells (e.g., rows or columns)).
is the constant or the intercept value to fix (e.g., zero). If missing, an intercept will not be fixed and is computed typically.
is a switch to select the return output (1 = Mean Value (default), 2 = Std Error, 3 = Test Score, 4 = P-Value, 5 = Upper Value, 6 = Lower Value).
Value Return
1 Mean Value (default).
2 Standard Error.
3 T-Stat.
4 P-Value.
5 Upper Limit.
6 Lower Limit.
Parameter Index
is a switch to designate the target parameter (0 = Intercept (default), 1 = Explanatory Variable).
Value Parameter Index
0 Intercept (default).
1 Explanatory Variable.
is the statistical significance of the test (i.e., alpha). If missing or omitted, an alpha value of 5% is assumed.


  1. The underlying model is described here.
  2. The regression slope (i.e., $\beta$) is computed as follows: $$\beta = \frac{\sum_{i=1}^N (X_i-\bar X)(Y_i-\bar Y)}{\sum_{i=1}^N (X_i-\bar X)^2}$$ And the intercept (i.e., $\alpha$) is expressed as follows: $$\alpha = \bar Y - \beta \bar X$$ Where:
    • $N$ is the number of observations.
    • $\bar X$ is the empirical sample average for the explanatory variable ($X$).
    • $\bar Y$ is the empirical sample average for the dependent variable ($Y$).
  3. The standard errors in the regression coefficients are expressed as follows: $$\mathrm{Var}(\beta) = \frac{\mathrm{MSE}}{\sum_{i=1}^N(X_i-\bar X)^2}$$ $$\mathrm{Var}(\alpha)=\mathrm{MSE}\times\left(\frac{1}{N}+\frac{\bar X^2}{\sum_{i=1}^N(X_i-\bar X)^2} \right )$$ Where:
    • $\mathrm{Var}(.)$ denotes the statistical variance.
    • $\mathrm{MSE} = \frac{\mathrm{SSE}}{N-2}= \frac{\sum_{i=1}^N (Y_i - \hat Y_i)^2}{N-2}$.
  4. The sample data may include data points with missing values.
  5. Each column in the input matrix corresponds to a separate variable.
  6. Each row in the input matrix corresponds to an observation.
  7. Observations (i.e., rows) with missing values in X or Y are removed.
  8. The number of rows of the response variable (Y) must equal the number of rows of the explanatory variable (X).
  9. The SLR_PARAM function is available starting with version 1.60 APACHE.

Files Examples

Related Links


  • Hamilton, J.D.; Time Series Analysis, Princeton University Press (1994), ISBN 0-691-04289-6.
  • Kenney, J. F. and Keeping, E. S. (1962) "Linear Regression and Correlation." Ch. 15 in Mathematics of Statistics, Pt. 1, 3rd ed. Princeton, NJ: Van Nostrand, pp. 252-285.


Article is closed for comments.

Was this article helpful?
0 out of 0 found this helpful