Skip to content

Commit

Permalink
Adds overal average for baby bonds and a chart for home ownership.
Browse files Browse the repository at this point in the history
  • Loading branch information
dc0sic committed Sep 11, 2024
1 parent f0f8a43 commit c3c9111
Show file tree
Hide file tree
Showing 6 changed files with 207 additions and 36 deletions.
35 changes: 29 additions & 6 deletions Analysis/Results/BabyBonds Atlanta.html

Large diffs are not rendered by default.

35 changes: 29 additions & 6 deletions Analysis/Results/BabyBonds Baltimore.html

Large diffs are not rendered by default.

35 changes: 29 additions & 6 deletions Analysis/Results/BabyBonds Boston.html

Large diffs are not rendered by default.

68 changes: 62 additions & 6 deletions Analysis/Results/BabyBonds Cities.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,18 @@ recode_degree = function(data)

# Results at Age 18

## The Average Baby-Bonds Amount

```{r}
bbavg = microdf |>
filter(age==18, scenario==1) |>
select(weight, bbonds) |>
summarise(bbonds=weighted.mean(bbonds, weight)) |>
pull() |> round()
```

The average amount of baby bonds for 18-year-olds born in 2024-2028 is `{r} paste0('$', format(bbavg, big.mark=","))`.

## The Average Baby-Bonds Amount by Race/Ethnicity

```{r}
Expand All @@ -222,12 +234,18 @@ df = microdf |>
summarise(bbonds=weighted.mean(bbonds, weight)) |>
recode_raceeth()
df |> ggplot() +
geom_col(aes(x=raceeth, y=bbonds), position=position_dodge()) +
df |> ggplot(aes(x=raceeth, y=bbonds)) +
geom_col(position=position_dodge()) +
scale_y_continuous(labels=function(x) x/1000) +
xlab("Race/ethnicity") + ylab("Baby bonds (1000s of $2023)") +
ggtitle("People age 18 born in 2024-2028")
ggtitle("People age 18 born in 2024-2028") +
geom_text(
aes(label=round(bbonds/1000)),
color="white",
vjust=1,
size=4,
show.legend = FALSE
)
```

Expand All @@ -250,8 +268,15 @@ df |> ggplot() +
geom_col(aes(x=lhinc0quin, y=bbonds, fill=raceeth), position=position_dodge()) +
scale_y_continuous(labels=function(x) x/1000) +
xlab("Quintile of family income at birth") + ylab("Baby bonds (1000s of $2023)") +
ggtitle("People age 18 born in 2024-2028")
ggtitle("People age 18 born in 2024-2028") +
scale_color_manual(values=c("white", "black", "white")) +
geom_text(
aes(x=lhinc0quin, y=bbonds, group=raceeth, color=raceeth, label=round(bbonds/1000)),
size=3,
position=position_dodge(width=.7),
vjust=1,
show.legend = FALSE
)
```

Expand Down Expand Up @@ -496,6 +521,37 @@ plot_by_scen(
```


## Homeownership by Race/Ethnicity and Sex

```{r}
#| label: fig-homeown-by-race-sex-45
#| fig-cap: "Homeownership by Race/Ethnicity and Sex"
df = microdf |>
filter(age==45) |>
select(raceeth, male, scenario, weight, ownhome) |>
group_by(raceeth, male, scenario) |>
summarise(
ownhome = weighted.mean(ownhome, weight)
) |>
ungroup() |>
recode_male() |>
recode_raceeth() |>
recode_scenario()
plot_by_scen(
df,
var=ownhome,
var_lab="Homeownership rate(%)",
class1=raceeth,
class1_lab="Race/ethnicity",
facet=~male,
scale=100,
title="People age 45 born in 2024-2028",
dodgewidth=.5
)
```

## Median Home Equity by Race/Ethnicity and Sex

```{r}
Expand Down
35 changes: 29 additions & 6 deletions Analysis/Results/BabyBonds Oakland.html

Large diffs are not rendered by default.

35 changes: 29 additions & 6 deletions Analysis/Results/BabyBonds USA.html

Large diffs are not rendered by default.

0 comments on commit c3c9111

Please sign in to comment.