QRS Toolbox for Excel

QRS.LOGISTIC.​REGRESSION


Premium function (only USD 29)   Client-side function

Returns the constant and coefficients of a logistic regression model.

Syntax

QRS.LOGISTIC.​REGRESSION(​X, y, [option name], [option value], …)

X[[number]]
Matrix containing the values of the independent variables with rows corresponding to observations and columns corresponding to variables.
y[number]
Column vector containing the values of the binary dependent variable.
option name/valueoptional
The name or value of an option. See the Options section for details.

Options

  • LABELS: TRUE to include labels in the output.
  • NAMES: Vector containing the name of the nth independent variable in the nth cell to include the names in the output.
  • MASK: Vector containing TRUE in the nth cell to indicate that the nth independent variable may be selected.
  • METHOD: String to use a variable selection method. None is used by default. The possible values are:
    • FORWARD for forward selection. Starting without any variable, the one with the smallest p-value less than PGREEN is selected recursively.
    • BACKWARD for backward selection. Starting with all variables, the one with the largest p-value greater than PRED is eliminated recursively.
    • STEPWISE for stepwise selection. Similar to forward selection, except backward selection is applied after each variable is selected.
  • LRTEST: String of comma-separated flags to include likelihood ratio test results in the output. The possible flags are:
    • D for test statistic.
    • P for p-value.
    • RAG for red/amber/green rating.
    • ALL for all of the above.
  • WALD: String of comma-separated flags to include Wald test results in the output. The possible flags are:
    • W for test statistic.
    • Z for z-score.
    • P for p-value.
    • SE for standard error.
    • RAG for red/amber/green rating.
    • ALL for all of the above.
  • PGREEN: Number between 0% and 100%. A p-value less than this number corresponds to a green rating. Defaults to 5%.
  • PRED: Number between the value of PGREEN and 100%. A p-value greater than this number corresponds to a red rating. Defaults to 10%.
  • TRANSPOSE: TRUE to swap the rows and columns of the output.

Remarks

  • Blank cells are read as zeros and dates are read as numbers due to Excel limitations.
  • The length of y must be the same as the row length of X.
  • The row length of X must be greater than the column length of X.
  • The p-values for the variable selection methods are based on the likelihood ratio test, rather than the Wald test.
  • The likelihood ratio test and Wald test are for the null hypothesis that the coefficient of a variable is zero.

Examples

Get from AppSource


Get it from Microsoft AppSource

Get from Excel


  1. Click Insert > Get Add-ins
  2. Search for QRS Toolbox
  3. Click Add