Skip to content

Commit 5d60d84

Browse files
Solomon KurzSolomon Kurz
authored andcommitted
mild updates and a new plot
1 parent eb3b015 commit 5d60d84

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

13.Rmd

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,7 @@ Just like in the text, our `male` slopes are much less dispersed than our interc
684684
Figure 13.6.a depicts the correlation between the full UCB model's varying intercepts and slopes.
685685

686686
```{r, fig.width = 3, fig.height = 3, warning = F, message = F}
687-
lost <- posterior_samples(b13.3)
687+
post <- posterior_samples(b13.3)
688688
689689
post %>%
690690
ggplot(aes(x = cor_dept_id__Intercept__male, y = 0)) +
@@ -1073,9 +1073,9 @@ posterior_summary(b13.7) %>%
10731073
round(digits = 2)
10741074
```
10751075

1076-
Our Gaussian process parameters are different than McElreath's. From the `gp` section of the [brms reference manual](https://cran.r-project.org/package=brms/brms.pdf), here's the brms parameterization:
1076+
Our Gaussian process parameters are different than McElreath's. From the `gp` section of the [brms reference manual](https://cran.r-project.org/package=brms/brms.pdf), we learn the brms parameterization follows the form
10771077

1078-
$$k(x_{i},x_{j}) = sdgp^2 \exp \big (-||x_i - x_j||^2 / (2 lscale^2) \big )$$
1078+
$$k(x_{i},x_{j}) = sdgp^2 \exp \big (-||x_i - x_j||^2 / (2 lscale^2) \big ).$$
10791079

10801080
What McElreath called $\eta$, Bürkner called $sdgp$. While McElreath estimated $\eta^2$, brms simply estimated $sdgp$. So we'll have to square our `sdgp_gplatlon2` before it's on the same scale as `etasq` in the text. Here it is.
10811081

@@ -1535,13 +1535,27 @@ tidy(b13.10) %>%
15351535
mutate_if(is.numeric, round, digits = 2)
15361536
```
15371537

1538-
And if you wanted a one-sided Bayesian $p$-value for the `male` dummy for the full model, you might execute this.
1538+
And if you wanted a one-sided Bayesian $p$-value for the `male` dummy for the full model, you execute something like this.
15391539

15401540
```{r}
15411541
posterior_samples(b13.10) %>%
15421542
summarise(one_sided_Bayesian_p_value = mean(b_male <= 0))
15431543
```
15441544

1545+
Here's a fuller look at the posterior.
1546+
1547+
```{r, fig.height = 2.5, fig.width = 6}
1548+
posterior_samples(b13.10) %>%
1549+
ggplot(aes(x = b_male, y = 0)) +
1550+
geom_vline(xintercept = 0, color = "#E8DCCF", alpha = 1/2) +
1551+
stat_halfeyeh(.width = c(.5, .95),
1552+
color = "#80A0C7", fill = "#394165") +
1553+
scale_y_continuous(NULL, breaks = NULL) +
1554+
xlab("b_male (i.e., the population estimate for gender bias)") +
1555+
coord_cartesian(xlim = c(-1.5, 1.5)) +
1556+
theme_pearl_earring()
1557+
```
1558+
15451559
So, the estimate of the gender bias is small and consistent with the null hypothesis. Which is good! We want gender equality for things like funding success.
15461560

15471561
## Reference {-}

0 commit comments

Comments
 (0)