Stratification Violation Error
A stratification violation error occurs when, due to an imposed limit, the system cannot maintain proportions between strata when forming a local control group (LCG). The warning does not stop the campaign but indicates that the control group may be formed with violated proportions.
The examples below use a database of 100 profiles. This small size is chosen intentionally — it makes it easier to track the logic behind the error. In real projects, databases can be much larger, but the principle of stratification remains the same.
Database fields and their distribution:
| Field | Values | Distribution |
|---|---|---|
int_field | 20 / 80 | 20% / 80% |
region | Moscow, SPb, Kazan | ~34 / ~33 / ~33 profiles |
age | 18–54 | uniform |
The error notification appears only when the limit is reached during LCG selection. During LCG formation, deviations may occur that the system tries to correct using new profiles added to the campaign, but cannot do so because of the imposed limit.
Example 1. Limit too small for the number of strata
Initial data
| Parameter | Value |
|---|---|
| Database | 100 profiles |
| Stratification | int_field (20 / 80) and region (Moscow, SPb, Kazan) |
| Number of strata | 6 |
| LCG size | 15% (should be 15 profiles) |
| LCG limit | 12 profiles |
Stratum distribution in the database
| Stratum | In database | Share | Expected in LCG (share × limit) |
|---|---|---|---|
| int_field=20 × Moscow | 6 | 6% | 0.72 → ~1 |
| int_field=20 × SPb | 7 | 7% | 0.84 → ~1 |
| int_field=20 × Kazan | 7 | 7% | 0.84 → ~1 |
| int_field=80 × Moscow | 28 | 28% | 3.36 → ~3 |
| int_field=80 × SPb | 26 | 26% | 3.12 → ~3 |
| int_field=80 × Kazan | 26 | 26% | 3.12 → ~3 |
Problem
Due to the limit of 12 profiles, the expected value for the stratum "20 × Moscow" is 0.72 — less than 1. The system cannot reliably fill such a stratum.
How to fix
- Increase the limit (e.g., to 35 profiles) — in this case, the LCG size must also be increased proportionally;
- Remove the limit entirely, leaving only the LCG percentage;
- Simplify stratification by removing fields with rare values (e.g., leave only
int_fieldwithout region breakdown).
Example 2. Critical heterogeneity in three‑field stratification
Initial data
| Parameter | Value |
|---|---|
| Database | 100 profiles |
| Segment | Profiles under 25 years old — 21 profiles |
| Stratification | int_field (20 / 80), region (Moscow, SPb, Kazan), age (18-21, 22-25) |
| Number of strata | 2 × 3 × 2 = 12 |
| LCG size | 10% |
| LCG limit | 8 profiles |
Stratum distribution in the segment and expected values in LCG
| Combination | In segment | Share | Expected in LCG |
|---|---|---|---|
| 20 × Moscow × 18-21 | 0 | 0% | 0 |
| 20 × Moscow × 22-25 | 1 | 4.8% | 0.38 → ~0 |
| 20 × SPb × 18-21 | 1 | 4.8% | 0.38 → ~0 |
| 20 × SPb × 22-25 | 1 | 4.8% | 0.38 → ~0 |
| 20 × Kazan × 18-21 | 0 | 0% | 0 |
| 20 × Kazan × 22-25 | 0 | 0% | 0 |
| 80 × Moscow × 18-21 | 3 | 14.3% | 1.14 → ~1 |
| 80 × Moscow × 22-25 | 2 | 9.5% | 0.76 → ~1 |
| 80 × SPb × 18-21 | 2 | 9.5% | 0.76 → ~1 |
| 80 × SPb × 22-25 | 5 | 23.8% | 1.90 → ~2 |
| 80 × Kazan × 18-21 | 2 | 9.5% | 0.76 → ~1 |
| 80 × Kazan × 22-25 | 4 | 19.0% | 1.52 → ~2 |
Problem
Due to the limit of 8 profiles, the expected value for strata with int_field=20 is 0 or close to 0. Empty strata themselves are not an error — they may reflect the actual state of the database if such profiles simply do not exist. The error occurs because the expected number of profiles in a stratum is too small and cannot be increased even when the campaign audience expands, as the limit restricts it, causing a loss of stratification homogeneity.
How to fix
Remove the limit — then the system will be able to add profiles from new arrivals. Or simplify stratification: remove age or broaden age ranges.
Example 3. Very small limit
Initial data
| Parameter | Value |
|---|---|
| Database | 100 profiles |
| Stratification | by int_field (20 / 80) |
| LCG limit | 1 profile |
| LCG size | 10% (10 profiles available, but limit restricts to 1) |
Problem
With a limit of 1 profile, the system cannot maintain proportions of 20% and 80%. In a sample of one profile, only two outcomes are possible: 0%/100% or 100%/0%. The deviation from the ideal proportion is 100%.
How to fix
Remove the limit or increase it to at least 10-20 profiles.