You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: ch8_conditional.qmd
+42-3Lines changed: 42 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -23,6 +23,7 @@ library(dagitty)
23
23
library(ggdag)
24
24
library(ggrepel)
25
25
library(ggthemes)
26
+
library(rcartocolor)
26
27
27
28
library(rethinking)
28
29
data(rugged)
@@ -228,13 +229,13 @@ The first thing to realize is that just including an indicator variable for Afri
228
229
229
230
To build a model that alls nations inside nd outside Africa to have different intercepts, we need to modify the model for $\mu_i$ so that the mean is conditional on continent. The conventional way to do this would be to just add another term to the linear model:
Where $\text{Africa}_i$ is a 0/1 indicator variable for Africa or not Africa. But this model assumes that african countries have more uncertainty inherently built into their $mu$ estimate, which makes no sense.
234
235
235
236
Our simple solution is to create separate intercepts for the different categories, like so:
0 commit comments