> For the complete documentation index, see [llms.txt](https://www.mlcompendium.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.mlcompendium.com/decision-intelligence/propensity-score-matching.md).

# Propensity Score Matching

When the treatment was not randomized, a fair comparison has to be built from observational data, and propensity score matching and propensity modeling are how. The page starts with the Python tool and its introduction, then the broader meaning of propensity, its types and use cases, and a logistic regression example, with a deprecated address kept at the end.

The tool comes first. [psmpy](https://pypi.org/project/psmpy/) is the package for propensity score matching for python and graphical plots. Its author, Adrienne Kline, explains it in the [propensity score matching intro](https://medium.com/data-science/psmpy-propensity-score-matching-in-python-a3e0cd4d2631), psmpy: Propensity Score Matching in Python — and why it's needed, which starts from the question "Do STEM programs in elementrary schools encourage more students to go into the sciences?" The same propensity score matching intro also sits at its original address, <https://towardsdatascience.com/psmpy-propensity-score-matching-in-python-a3e0cd4d2631>, which describes performing propensity score matching in a python environment using a newly available library: psmpy, with graphical plotting features.

Matching is one use of a propensity; marketing uses the same score to predict behavior. [a meta discussion about propensity](https://medium.com/the-official-integrate-ai-blog/heres-what-you-need-to-know-about-propensity-modeling-521ab660cb43) is Here's What You Need to Know About Propensity Modeling, which starts from marketers' goal of the right messages to the right people at the right time, and how hard hyper-personalization is to pull off. [types of propensity and use cases](https://www.altexsoft.com/blog/propensity-model/) is Propensity Modeling with Machine Learning: what propensity modeling is and how to build predictive propensity models using the power of machine learning. The [log reg example](https://datatonic.com/insights/propensity-scoring-free-report/) is What is Propensity Scoring and Why Should You be Using it?, on forecasting customer behaviour with propensity scoring as one of the most effective ways to personalise customer experience.

## Deprecated links

{% hint style="warning" %}
These links and images no longer work. The original wording is kept here. A same-resource copy, when one was checked, is used above.
{% endhint %}

* Fit multiple propensity models and choose the best performing one for implementing a profit optimisation by Diego usai. This address no longer opens: <https://towardsdatascience.com/using-h2o-and-dalex-to-estimate-the-likelihood-to-purchase-a-financial-product-a53f891f0d1>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.mlcompendium.com/decision-intelligence/propensity-score-matching.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
