Places a one-day diet in one of ten decile bands of a global reference distribution of per capita daily dietary environmental impacts.
Arguments
- value
Numeric vector of per capita daily impact.
- group
Integer vector of demographic groups 1-8, from [eiod_age_sex_group()].
- indicator
One of the seven indicator names; see [eiod_list_indicators()].
- midpoint
If `TRUE`, return the band midpoint percentile (5, 15, ... 95) instead of the band number. Default `FALSE`.
- details
If `TRUE`, return a data frame that also reports the band boundaries each observation was placed between. Default `FALSE`.
Value
An integer vector of bands 1-10, or of midpoints if `midpoint = TRUE`. `NA` where the impact or the group is missing.
If `details = TRUE`, a data frame with one row per observation and the columns `value`, `group`, `band`, `cut_lower` and `cut_upper`. `cut_lower` is the highest published percentile the value cleared, and is `NA` in band 1 - correctly, because nothing is published below P10. `cut_upper` is `NA` in band 10 for the same reason. (Equivalent to `cutvar()` in the companion Stata command.)
What the comparison is against
This does **not** rank respondents against each other in your survey. Each diet is compared against a fixed external reference distribution that is the same for every analysis anywhere in the world. Intake built it by taking per-country average dietary impact per person per day at each decile from the Planet-Based Diets Database, population-weighting to a global percentile distribution using 2010 country populations, and scaling the result to each demographic group by its share of average energy requirements.
The practical consequence: **do not compute this with `quantile()`, `cut()` or `ntile()`**. Those rank your sample against itself and will place roughly 10 different statistic with no cross-country meaning. The cut-points come from the published tables, not from your data.
If your whole sample has low impacts, your whole sample lands in low bands. That is intended, and is the reason the metric is comparable across countries and over time.
A low band is not evidence of sustainability
The reference distribution describes diets as they are, not as they would need to be. For greenhouse gas emissions the Table 3 absolute planetary-boundary threshold lies *below* the 10th percentile of the reference distribution, so a diet in band 1 still exceeds the planetary boundary. For water use the threshold sits *above* the 90th percentile, so essentially every diet passes. Report the two metric families together and never one as a proxy for the other.
Band definitions
| 1 | impact < P10 |
| 2 | P10 <= impact < P20 |
| ... | ... |
| 9 | P80 <= impact < P90 |
| 10 | impact >= P90 |
The inequality is strict, so a diet exactly on P10 belongs in band 2.
Reporting a mean band
The paper also reports a mean position. Use `midpoint = TRUE` to get band midpoints (5, 15, ... 95) for that purpose, but note the limitation: averaging an ordinal band index treats the bands as equally spaced on the impact scale, and they are not. In Table 4c the P10-P20 gap is 0.002 m2*year while the P80-P90 gap is 1.5 m2*year. A mean band is a summary of *position in the reference distribution*; it is not a summary of impact. For a mean impact, average the impact variable itself.
Storage type is checked here, not only in the check suite
As for [eiod_absolute_threshold()], an integer `value` is refused. See that function for why `is.numeric()` alone is not enough. The rest of the data quality suite remains opt-in; run `vignette("precision")` first.
Examples
data(eiod_demo)
grp <- eiod_age_sex_group(eiod_demo$age, eiod_demo$sex)
# the column is biodiv_pdf; the indicator key is "biodiv"
band <- eiod_relative_band(eiod_demo$biodiv_pdf, grp, "biodiv")
table(band, useNA = "ifany")
#> band
#> 1 2 3 4 5 6 7 8 9 10 <NA>
#> 212 3 27 19 1 67 44 99 64 52 12
# mean position in the global reference distribution
mid <- eiod_relative_band(eiod_demo$biodiv_pdf, grp, "biodiv",
midpoint = TRUE)
mean(mid, na.rm = TRUE)
#> [1] 45.64626
# the decile boundaries each diet was judged against
head(eiod_relative_band(eiod_demo$biodiv_pdf, grp, "biodiv",
details = TRUE))
#> value group band cut_lower cut_upper
#> 1 1.670692e-12 4 8 1.537477e-12 2.494486e-12
#> 2 5.547457e-13 4 1 NA 7.041503e-13
#> 3 9.416969e-13 4 6 9.039909e-13 1.224707e-12
#> 4 2.538843e-13 4 1 NA 7.041503e-13
#> 5 6.225413e-12 8 10 2.928390e-12 NA
#> 6 1.250413e-12 4 7 1.224707e-12 1.537477e-12