Skip to main content
v2026.11,858 entries · CC-BY 4.0

Types of Regression Analysis: Which to Use for Your Outcome

Which regression type fits your outcome? A decision table mapping OLS, logistic, Poisson, ridge and quantile models to statsmodels, scikit-learn and R.

Written and maintained by CASRAI Editorial Board

Last updated

Types of regression analysis differ mainly by the outcome variable and the problem in the data. Ordinary least squares fits a continuous outcome; logistic, Poisson and Gamma models are generalized linear models (GLMs) for binary, count and positive skewed outcomes; ridge, lasso and elastic-net handle many predictors; robust and quantile regression handle outliers and non-mean questions. This guide maps each type to the exact class or function in statsmodels, scikit-learn and R. Software documentation was read on 2026-11-08.

What it is used for in research

Regression estimates how an outcome changes with one or more predictors. The choice of type is driven by what the outcome looks like and which assumption is at risk, not by the software. The table below is the decision aid; the sections after it show how to run the choice.

Situation Type statsmodels scikit-learn R (stats)
Continuous outcome, errors with constant variance Ordinary least squares (OLS) OLS LinearRegression lm()
Unequal error variance or correlated errors Weighted / generalized least squares WLS, GLS, GLSAR – –
Binary outcome Logistic regression (GLM, binomial family, logit link by default) GLM with a binomial family LogisticRegression glm(..., family = binomial)
Count outcome Poisson regression (GLM, log link by default) GLM with a Poisson family PoissonRegressor / TweedieRegressor (power = 1) glm(..., family = poisson)
Counts or proportions more variable than the model allows (over-dispersion) Quasi-Poisson / quasi-binomial – – family = quasipoisson, family = quasibinomial
Positive, right-skewed continuous outcome Gamma regression – TweedieRegressor (power = 2) family = Gamma
Many predictors, shrink coefficients Ridge (L2), lasso (L1), elastic net – Ridge, Lasso, ElasticNet –
Outliers or corrupt data Robust regression – robust estimators (section 1.1.14) –
Median or other quantile of the outcome, not the mean Quantile regression QuantReg QuantileRegressor –
Curved relationship, still linear in the parameters Polynomial regression OLS on transformed columns linear model on polynomial features lm() with terms such as I(x^2)

Cells marked “-” mean the packages’ linear-model documentation read for this guide does not list a dedicated class for that row. Cox and other time-to-event models are covered separately in Cox proportional hazards model explained.

Two clarifications that prevent common mistakes

  • Logistic, Poisson and Gamma regression are generalized linear models. scikit-learn describes a GLM as an inverse link function combined with the unit deviance of an exponential-family distribution. R’s family objects set the default link: binomial uses logit, poisson uses log, Gamma uses inverse, gaussian uses identity (and lm() is the gaussian case).
  • Polynomial regression is still linear regression. scikit-learn’s documentation presents it as a linear model fitted on nonlinear functions of the data, so the same OLS machinery and diagnostics apply.

Install or access (official source only)

  • statsmodels (Python): documentation at statsmodels.org; the regression models are described on its Linear Regression page.
  • scikit-learn (Python): documentation at scikit-learn.org, section 1.1 “Linear Models”.
  • R: lm(), glm() and the family objects are in the base stats package, so no extra install is needed.

Step-by-step: choose and fit the type

  1. Name the outcome type. Continuous, binary, count, positive skewed, or something where the median matters more than the mean.
  2. Pick the row in the table. Start with OLS for a continuous outcome; start with a GLM family for binary, count or positive-skewed outcomes.
  3. Fit the model. Examples, with y, x1, x2 and df standing for your own data:
    # Python, statsmodels formula API import statsmodels.api as sm import statsmodels.formula.api as smf ols   = smf.ols("y ~ x1 + x2", data=df).fit() logit = smf.glm("y ~ x1 + x2", data=df, family=sm.families.Binomial()).fit() pois  = smf.glm("y ~ x1 + x2", data=df, family=sm.families.Poisson()).fit() med   = smf.quantreg("y ~ x1 + x2", data=df).fit(q=0.5)  # R (stats) fit_lm   <- lm(y ~ x1 + x2, data = df) fit_bin  <- glm(y ~ x1 + x2, family = binomial, data = df) fit_pois <- glm(y ~ x1 + x2, family = poisson,  data = df) fit_qp   <- glm(y ~ x1 + x2, family = quasipoisson, data = df) summary(fit_pois)
  4. Check the assumption that motivated the choice. If count residuals are more variable than the Poisson model allows, switch to quasi-Poisson (R documents that the quasi families do not fix the dispersion at one and can model over-dispersion). If error variance is unequal, use weighted least squares. For numerous predictors, move to ridge, lasso or elastic net.
  5. Report the type and software. State the model family, link, package and version in the methods section.

Output and how to read it

Every type reports a coefficient per predictor with a standard error and test statistic, but the scale differs. In OLS the coefficient is the change in the outcome per unit of the predictor. In a GLM the coefficient is on the link scale: the log-odds scale for logistic regression and the log scale for Poisson regression, because those are the default links. Exponentiating a logistic coefficient gives an odds ratio and exponentiating a Poisson coefficient gives a rate ratio. Quantile regression coefficients describe the chosen quantile; scikit-learn notes that quantile regression estimates the median or other quantiles of y conditional on X, while OLS estimates the conditional mean, so the two can differ when the outcome is skewed.

Ridge and lasso coefficients are deliberately shrunk. scikit-learn explains that ridge imposes a penalty on coefficient size and lasso can set coefficients exactly to zero, so shrunken estimates are not directly comparable to unpenalized OLS estimates.

Troubleshooting

Free alternatives (table)

statsmodels, scikit-learn and R are all free and open source. Each type also has a dedicated CASRAI guide:

Type CASRAI guide
Linear and multiple regression Linear regression and multiple regression
Weighted least squares Weighted least squares
Poisson regression Poisson regression analysis
Multinomial logistic Multinomial logistic regression
Ordinal logistic Ordinal logistic regression
Quantile regression Quantile regression analysis
Logistic in Python scikit-learn logistic regression

FAQ

What are the main types of regression analysis?

Linear (OLS), logistic, Poisson, Gamma, ridge, lasso, elastic net, robust, quantile and polynomial regression are the types covered in the scikit-learn, statsmodels and R documentation read for this guide. Choose by outcome variable first.

Is logistic regression really regression?

Yes. It is a generalized linear model with a binomial family and a logit link by default in R. scikit-learn calls its implementation a linear model for classification.

What is the difference between ridge and lasso?

Both penalize coefficient size. Lasso can set coefficients exactly to zero, giving sparse models; ridge shrinks without zeroing. Elastic net uses both penalties.

Is polynomial regression nonlinear?

It models a curved relationship but is linear in the parameters, so it is fitted as a linear model on transformed predictors.

Sources (official docs)

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · free to try

Ask about Types of Regression Analysis: Which to Use for Your Outcome

Ask your first 2 questions free below. Subscribers get 150 a day for $29 a month.

An AI assistant specialized in research administration. It cites the sources behind every answer, labels web answers and says when it can't answer.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays free to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →