Enter Dataset Inputs
Use one row per line in both text areas. Each target value aligns with the condition on the same line number.
Example Data Table
This sample demonstrates how missing target values are replaced by the mean within each matching condition group.
| Row | Condition | Observed Target | Group Mean Used | Completed Target |
|---|---|---|---|---|
| 1 | A | 88 | 90.0000 | 88.0000 |
| 2 | A | 92 | 90.0000 | 92.0000 |
| 3 | A | NA | 90.0000 | 90.0000 |
| 4 | B | 75 | 78.0000 | 75.0000 |
| 5 | B | 81 | 78.0000 | 81.0000 |
| 6 | B | NA | 78.0000 | 78.0000 |
| 7 | C | 90 | 84.0000 | 90.0000 |
| 8 | C | NA | 84.0000 | 84.0000 |
| 9 | C | 78 | 84.0000 | 78.0000 |
| 10 | C | 84 | 84.0000 | 84.0000 |
Formula Used
Conditional mean for group g:
Mean(g) = Σ observed target values in group g ÷ observed count in group g
Imputed value for missing row i:
ŷi = Mean(gi) when row i belongs to group gi
When a row is missing, the calculator looks up the row’s condition label, finds the observed mean within that subgroup, and inserts that mean as the replacement value.
If a subgroup has no observed values, the calculator applies your chosen fallback: overall mean, custom value, or leaving the value missing.
How to Use This Calculator
- Enter the target variable values, one per line. Use blank, NA, or your chosen token for missing entries.
- Enter the condition labels in the second text area. Each label must align with the target value on the same row.
- Choose what happens when a subgroup lacks observed values. You can use the overall mean, a custom value, or leave it missing.
- Set decimal places and optional missing tokens, then submit the form.
- Review the result panel above the form, inspect group means and completed rows, then download CSV or PDF reports.
FAQs
1. What does conditional mean imputation do?
It fills a missing target value with the average observed value from the same subgroup, such as department, region, grade, or treatment arm.
2. When should I use this method?
Use it when missing values are reasonably explained by a grouping variable and when preserving subgroup level differences matters more than keeping full variability.
3. Does this method change variance?
Yes. Mean based imputation usually shrinks within group variation because every missing value receives the same subgroup average.
4. What if a group has no observed values?
The calculator can fall back to the overall mean, a custom value, or keep the entry missing, depending on your selection.
5. Can I use text labels for conditions?
Yes. Condition groups can be letters, names, codes, or categories. The target variable itself must still be numeric for mean computation.
6. Why do line positions matter?
Each line is treated as one observation. The first target value pairs with the first condition label, the second with the second, and so on.
7. Is this better than overall mean imputation?
Often yes, because it respects subgroup structure. However, it still reduces uncertainty and may bias downstream inference in complex analyses.
8. What can I export from this page?
You can export the completed dataset as CSV and save the visible results panel as a PDF for documentation or reporting.