*! version 1.0 18 Oct 2020

Title

reg2logit -- Approximates logistic regression parameters using OLS linear regression.

Syntax

reg2logit
{yvar} [{xvars}] [if] [in]
[, options]

Optional
iterate(#) Number of times to iterate after transforming the OLS parameter estimates. Default value is 0.

Description

reg2logit estimates the parameters of a logistic regression of yvar on xvars by transforming OLS estimates of the linear regression of yvar on xvars.
Factor xvars are allowed.
The transformation formula, first derived by Haggstrom (1983), is discussed by Allison (2020).

The transformed OLS estimates are fully efficient estimates of the logistic regression under the assumption that the xvars are multivariate normal conditionally on the value of the yvar.
If the xvars are in fact conditionally multivariate normal, then the estimates produced by reg2logit are more efficient than the "distribution-free" estimates produced by the logit command,
which assume nothing about the distribution of the xvars.
If the xvars are not conditionally multivariate normal, then reg2logit may be more or less efficient than logit, depending on how much the xvars depart from conditional multivariate normality.
Even when they are less efficient than the logit estimates, the reg2logit estimates are often similar and have the advantage of running more quickly and without iteration.
In the various conditions that have been tested by simulation, reg2logit produced predicted probabilities that are very similar to those produced by logit, except when the model included strong interactions (Allison 2020).

By default, reg2logit returns the transformed OLS coefficients.
If you set the iter() option to a value greater than zero, reg2logit iterates toward the same distribution-free maximum likelihood estimates produced by logit.

After reg2logit, you can run predict to get predicted probabilities, just as you can after logit.

Examples

sysuse auto, clear

/* Approximate logistic regression coefficients from the OLS estimates: */

reg2logit foreign weight price

/* Iterate toward maximum likelihood estimates of the logistic regression coefficients.... */

reg2logit foreign weight price, iter(200)

/* ...which are not terribly different in this example */

Applications

reg2logit has several applications.

1. In some settings -- e.g., with big data or many correlated xvars -- iterative commands like logit can be slow to produce maximum likelihood estimates (Minka 2003; Ji & Telgarsky 2018).
reg2logit produces estimates quickly, without iteration. The estimates are often serviceable, often quite close to the maximum likelihood estimates,
and in fact are fully efficient estimates if xvars is conditionally multivariate normal.

2. If you set the iter() option to a value greater than zero, the transformed OLS estimates provide a plausible starting point for iteration toward maximum likelihood estimates.
Yet suprisingly, convergence is not necessarily faster than it is with the logit command, which starts with slope estimates of zero.

3. In some settings, predicted probabilities must be obtained from a linear probability model. reg2logit followed by predict provides the best way of doing this (Allison 2020).

4. One application for these predicted probabilities is to impute dummy variables after fitting a multivariate normal imputation model. This is implemented by our mi_impute_genmod command,
which you can install using ssc install mi_impute_genmod.

Technical notes

When run with iter() at the default of 0, reg2logit returns a "Warning: Convergence not achieved."
You can generally ignore this, as it merely indicates that no iterations have been performed.

When run with iter() at the default of 0, reg2logit does not require yvar to be binary 0/1.
This laxity can be helpful in some problems, such as imputation problems where values of yvar other than 0 and 1 have previously been imputed by a normal model.

References

Allison, P.D. (2020, April 24). Better predicted probabilities from linear probability models. Statistical Horizons blog. https://statisticalhorizons.com/better-predicted-probabilities

Haggstrom, G. W. (1983). Logistic regression and discriminant analysis by ordinary least squares. Journal of Business & Economic Statistics, 1(3), 229-238.

Ji, Z., & Telgarsky, M. (2018). Risk and parameter convergence of logistic regression. arXiv preprint arXiv:1803.07300.

Minka, T. P. (2003). A comparison of numerical optimizers for logistic regression. Unpublished manuscript, http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.85.7017&rep=rep1&type=pdf.

Authors

Paul von Hippel <paulvonhippel@utexas.edu>
Rich Williams <Richard.A.Williams.5@nd.edu>
Paul Allison <allison@statisticalhorizons.com>