Skip to content

Commit

Permalink
fix cement production estimates by adjusting filtered regression data
Browse files Browse the repository at this point in the history
  • Loading branch information
0UmfHxcvx5J7JoaOhFSs5mncnisTJJ6q committed Oct 9, 2024

Verified

This commit was signed with the committer’s verified signature. The key has expired.
1 parent e7a355c commit 66d9708
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions R/EDGE-Industry.R
Original file line number Diff line number Diff line change
@@ -1730,19 +1730,35 @@ calcIndustry_Value_Added <- function(subtype = 'physical',
) %>%
filter(!is.na(.data$cement.production))

### censor nonsensical data ----
cement_censor <- list_to_data_frame(list(
BDI = 1980:2010, # zero cement production
CIV = 1990:1993, # cement VA 100 times higher than before and after
NAM = 2007:2010, # zero cement production
HKG = 1973:1979, # no data for CHN prior to 1980
IRQ = 1992:1997, # cement VA 100 times higher than before and after
RUS = 1970:1990, # exclude data from Soviet period which biases
# projections up
NULL),
'iso3c', 'year') %>%
mutate(censored = TRUE)

regression_data_cement <- regression_data_cement %>%
anti_join(cement_censor, c('iso3c', 'year'))

### compute regional and World aggregates ----
regression_data_cement <- regression_data_cement %>%
inner_join(
population %>%
group_by(.data$iso3c, .data$year) %>%
summarise(population = calc_mode(.data$population), .groups = 'drop'),
filter('SSP2' == .data$scenario) %>% # TODO: define default scenario
select(-'scenario'),

c('iso3c', 'year')
) %>%
inner_join(
GDP %>%
group_by(.data$iso3c, .data$year) %>%
summarise(GDP = calc_mode(.data$GDP), .groups = 'drop'),
filter('SSP2' == .data$scenario) %>% # TODO: define default scenario
select(-'scenario'),

c('iso3c', 'year')
) %>%

0 comments on commit 66d9708

Please sign in to comment.