@@ -892,9 +892,9 @@ transformed parameters {
892
892
893
893
```
894
894
895
- ``` {r tsuga_unpooled_compile, cache = TRUE, message = FALSE, error = FALSE, echo = FALSE}
895
+ ``` {r tsuga_unpooled_compile, results = 'hide', cache = TRUE, message = FALSE, error = FALSE, echo = FALSE}
896
896
# compile the model (below)
897
- tsuga_unpooled = stan_model("../vu_advstats_students/stan/tsuga_unpooled.stan")
897
+ tsuga_unpooled <- stan_model("../vu_advstats_students/stan/tsuga_unpooled.stan")
898
898
```
899
899
900
900
@@ -975,12 +975,13 @@ grid.arrange(pl_probs_unpooled, pl_err_unpooled, ncol=2)
975
975
:::: {.column}
976
976
977
977
* We don't really expect each year to be independent
978
- - it's all one species, response to temperature should be similar
978
+ - it's all one species, response to precipitation should be similar
979
979
- some years are better or worse than others
980
- * Imagine instead there is a population of possible years, each with its own mortality
981
- * This population has a true mean and a true variance
982
- * The samples we've taken will come from that distribution
983
- * This can tell us something about all possible years, not just these years
980
+
981
+ > - Imagine instead there is a population of possible years, each with its own mortality
982
+ > - This population has a true mean and a true variance
983
+ > - The samples we've taken will come from that distribution
984
+ > - This can tell us something about all possible years, not just these years
984
985
985
986
986
987
::::
@@ -1179,11 +1180,25 @@ grid.arrange(pl_intervals_pooled + ggtitle("Pooled"),
1179
1180
```
1180
1181
1181
1182
1183
+ ## When do we need hierarchical models?
1184
+ > - Repeated sampling within units (e.g., samples nested within plots/individuals)
1185
+ > - Inference at multiple levels of organisation (e.g., Covariates at multiple spatial scales)
1186
+ > - Uneven sampling among units (Number of trees by year)
1187
+ > - Accounting for nonindependence of samples
1188
+
1182
1189
## When do we need hierarchical models?
1183
1190
* Repeated sampling within units (e.g., samples nested within plots/individuals)
1184
- * Inference at multiple levels of organisation
1185
- - Covariates at multiple spatial scales
1186
- * Uneven sampling among units
1191
+ * Inference at multiple levels of organisation (e.g., Covariates at multiple spatial scales)
1192
+ * Uneven sampling among units (Number of trees by year)
1193
+ * Accounting for nonindependence of samples
1194
+ * Avoiding pre-averaging
1195
+ - Don't: perform repeat samples on a unit, perform analysis on the average
1196
+ - Do: Build an HM accounting for variability within and among units
1197
+
1198
+ ## When do we need hierarchical models?
1199
+ * Repeated sampling within units (e.g., samples nested within plots/individuals)
1200
+ * Inference at multiple levels of organisation (e.g., Covariates at multiple spatial scales)
1201
+ * Uneven sampling among units (Number of trees by year)
1187
1202
* Accounting for nonindependence of samples
1188
1203
* Avoiding pre-averaging
1189
1204
- Don't: perform repeat samples on a unit, perform analysis on the average
@@ -1192,7 +1207,6 @@ grid.arrange(pl_intervals_pooled + ggtitle("Pooled"),
1192
1207
- All mixed models are hierarchical, not all hierarchical models are mixed models
1193
1208
1194
1209
1195
-
1196
1210
## Designing hierarchical models in Stan
1197
1211
::: {.columns}
1198
1212
:::: {.column}
0 commit comments