Skip to content

Commit

Permalink
kick-off graph 2
Browse files Browse the repository at this point in the history
  • Loading branch information
andkov committed Aug 19, 2022
1 parent 0cc522d commit 056adac
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions analysis/economic-outcomes/economic-outcomes-andriy.R
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ d <-

d %>% glimpse()

d <-
ds0_wide %>%
select(hromada_code, hromada_type3, tot, time, tax_revenue)
d
g <-
d %>%
filter(hromada_type3 !="urban") %>%
Expand All @@ -144,6 +148,42 @@ g <-

g %>% quick_save("1-outcome-scatterplot", w=12, h = 9)
# ---- graph-2 -----------------------------------------------------------------
# distribution of tax revenue across regions

d <-
ds0_wide %>%
# filter(time %in% 2020:2021) %>% #glimpse()
filter(time %in% 2021) %>% #glimpse()
select(hromada_code, hromada_type3, tot, time, tax_revenue) %>%
left_join(
ds_admin %>% select(hromada_code, region_ua)
) %>%
group_by(time) %>%
mutate(
percentile = dplyr::ntile(tax_revenue, 100 )
) %>%
filter(percentile < 95)
g <-
d %>%
{
ggplot(
.
,aes(
x = tax_revenue
# ,fill = as.factor(time)
# ,fill = region_ua
# ,color = time
)
)+
geom_density( alpha = .1)+
# facet_wrap(facets = "time")+
facet_wrap(facets = "region_ua")+
scale_x_continuous(label = scales::comma_format())+
scale_y_continuous(label = scales::percent_format())+
labs()
}
g
g %>% quick_save("2-regions-tax", w=12, h=6)

# ---- graph-3 -----------------------------------------------------------------

Expand Down

0 comments on commit 056adac

Please sign in to comment.