# 025. Prior-contact recency and response

**Question:** How does response differ between never-contacted clients and prior-contact recency bands?

## Result

The largest computed metric is 0.4208 for (30.0, 90.0]; the smallest is 0.09157 for Never previously contacted. Metric: rate (Subscription share).

The -1 sentinel is not a negative elapsed time. Small groups have wider uncertainty.

![Prior-contact recency and response](outputs/chart.png)

| recency_band | events | n | rate | wilson_lower | wilson_upper |
| --- | --- | --- | --- | --- | --- |
| (-0.001, 30.0] | 28 | 188 | 0.1489 | 0.1051 | 0.2068 |
| (180.0, 365.0] | 786 | 4416 | 0.178 | 0.167 | 0.1895 |
| (30.0, 90.0] | 223 | 530 | 0.4208 | 0.3794 | 0.4632 |
| (365.0, inf] | 188 | 643 | 0.2924 | 0.2585 | 0.3287 |
| (90.0, 180.0] | 680 | 2480 | 0.2742 | 0.257 | 0.2921 |
| Never previously contacted | 3384 | 36954 | 0.09157 | 0.08867 | 0.09456 |

The chart shows 6 of 6 result rows; the table previews the first 6 in the analysis-defined order. [Download the full result table](outputs/results.csv). Numerical values are computed from the source; missing results stay unavailable.

## Method

Preserve pdays=-1 as a sentinel category before computing rate intervals.

The study uses shared source preparation and reusable statistical routines. Its specific transformations are in [analysis.py](analysis.py), and common model/evaluation code is in [portfolio/methods.py](../../portfolio/methods.py). The [notebook](analysis.ipynb) executes the study and displays the saved results.

## Decision and limitations

Keep never-contacted records distinct when evaluating engagement history.

Observational marketing records do not identify campaign uplift. Month and row order are not precise timestamps; repeated-client identifiers are unavailable. Models are research diagnostics, not financial eligibility or automated contact decisions. 

Related studies may share observations or holdouts. These are focused analytical studies, not independent replications or deployed business systems. Any model refinements informed by these results need new untouched evaluation data. No commercial impact is inferred from an association or backtest.

## Reproduce

From the repository root, after installing `requirements.txt`:

```powershell
python projects/025-prior-contact-recency-and-response/analysis.py
```

Source data are downloaded automatically if absent. Original archives are retained unchanged and checked by SHA-256. The cleaned cache normalizes column names; field-specific changes are visible in [data preparation](../../portfolio/data.py). Runtime evidence is in [receipt.json](outputs/receipt.json).

## Source

[Bank Marketing](https://archive.ics.uci.edu/dataset/222/bank+marketing), Moro, Rita and Cortez (2014). [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). Source data are transformed and aggregated in this study. [Source provenance](../../data/provenance/bank.json) and [prepared-data audit](../../data/provenance/bank_prepared.json) record the downloaded files, field coverage and hashes.
