Untitled

library(tidyverse)
── Attaching core tidyverse packages ──────────────────────── tidyverse 2.0.0 ──
✔ dplyr     1.1.4     ✔ readr     2.1.5
✔ forcats   1.0.0     ✔ stringr   1.5.1
✔ ggplot2   3.5.1     ✔ tibble    3.2.1
✔ lubridate 1.9.3     ✔ tidyr     1.3.1
✔ purrr     1.0.2     
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag()    masks stats::lag()
ℹ Use the conflicted package (<http://conflicted.r-lib.org/>) to force all conflicts to become errors
library(brms)
Loading required package: Rcpp
Loading 'brms' package (version 2.21.0). Useful instructions
can be found by typing help('brms'). A more detailed introduction
to the package is available through vignette('brms_overview').

Attaching package: 'brms'

The following object is masked from 'package:stats':

    ar
library(tidybayes)

Attaching package: 'tidybayes'

The following objects are masked from 'package:brms':

    dstudent_t, pstudent_t, qstudent_t, rstudent_t
library(gt)
x <- read_csv("data/resume.csv")
Rows: 4870 Columns: 4
── Column specification ────────────────────────────────────────────────────────
Delimiter: ","
chr (3): firstname, sex, race
dbl (1): call

ℹ Use `spec()` to retrieve the full column specification for this data.
ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
fit_data <- brm(formula = call ~ race, data = x, family = bernoulli(), seed = 9, silent = 2, refresh = 0)
fit_data |> 
  add_epred_draws(newdata = tibble(race = c("white", "black"))) |>
  select(race, .epred) |> 
  ggplot(aes(x = .epred, fill = race)) + 
  geom_histogram(aes(y = after_stat(count/sum(count))))
Adding missing grouping variables: `.row`
`stat_bin()` using `bins = 30`. Pick better value with `binwidth`.