class: center, middle, inverse, title-slide .title[ # Bayesian Linear Models ] .subtitle[ ## 04 - Binary outcomes ] .author[ ### Stefano Coretta ] .institute[ ### University of Edinburgh ] .date[ ### 2023/07/07 ] --- ## The MALD data: Accuracy <img src="index_files/figure-html/unnamed-chunk-1-1.png" height="500px" style="display: block; margin: auto;" /> --- layout: true ## Binary outcomes --- ```r rt_bm_5 <- brm( ACC ~ IsWord, data = mald, family = "bernoulli", backend = "cmdstanr", cores = 4, file = "./data/cache/rt_bm_5", seed = my_seed ) ``` .bg-washed-blue.b--dark-blue.ba.bw2.br3.shadow-5.ph4.mt2[ - Bernoulli is the family of probability distributions used for binary variables. ] --- ``` ## Population-Level Effects: ## Estimate Est.Error l-89% CI u-89% CI Rhat Bulk_ESS Tail_ESS ## Intercept -2.24 0.09 -2.38 -2.11 1.00 2604 2534 ## IsWordFALSE 0.43 0.11 0.25 0.61 1.00 3484 2713 ``` -- What are those numbers?! --- <img src="index_files/figure-html/p-log-odds-1.png" height="500px" style="display: block; margin: auto;" /> --- <img src="index_files/figure-html/rt-bm-5-plot-1.png" height="500px" style="display: block; margin: auto;" /> --- ``` ## Population-Level Effects: ## Estimate Est.Error l-89% CI u-89% CI Rhat Bulk_ESS Tail_ESS ## Intercept -2.24 0.09 -2.38 -2.11 1.00 2604 2534 ## IsWordFALSE 0.43 0.11 0.25 0.61 1.00 3484 2713 ``` <br> ```r round(plogis(-2.24), 2) ``` ``` ## [1] 0.1 ``` ```r round(plogis(-2.24 + 0.43), 2) ``` ``` ## [1] 0.14 ```