g_logreg(G;S;Y;XX;Z)
Returns a model corresponding to the logistic regression of one or more independent variables against a given dependent variable.
Function type
Vector only
Syntax
g_logreg(G;S;Y;XX;Z)
Input
Argument | Type | Description |
---|---|---|
G |
any | A space- or comma-separated list of column names Rows are in the same group
if their values for all of the columns listed in If If any of the columns listed in |
S |
integer | The name of a column in which every row evaluates to a 1 or 0, which determines
whether or not that row is selected to be included in the calculation If
If any of the values in
|
Y |
integer or decimal | A column name denoting the dependent variable |
XX |
integer or decimal | A space- or comma-separated list of column names denoting
the independent variable(s) The first element of
|
Z |
text and decimal | A list of pairs of option names and option values that control convergence
criteria For example: 'cgdeveps' 0.0000001 'lreps' 0.000000001 The options you may specify for the
The following options can be specified for the 'trirls'
method:
Note: Only one of
'cgdeveps' or 'cgeps' may be
specified!To obtain closer fits for low-dimensional problems, try reducing
|
Return Value
For every row in each group defined by G
(and for those rows where
S
=1, if specified), g_logreg
computes a logistic regression for the independent variable(s) XX
against
the dependent variable Y
and returns a special type representing a model
for each group in the data.
g_logreg
returns can be used as an argument to the
following functions:param(M;P;I)
to extract the regression model parametersscore(XX;M;Z)
to score data points according to the regression model
g_logreg
may be much slower if there is significant multicollinearity
in the data (i.e., if two or more of the independent variables XX
are
nearly perfectly correlated with each other).M
is the column containing the result of
g_logreg
, use the following function calls to obtain the desired information:param(M;'b';N)
N
th coefficient of the model (corresponding to theN
th data column inXX
)score(XX;M;)
- Predicted
Y
for data pointsXX
according to the model