| scientistID | county_name | recorded_temp |
|---|---|---|
| #74991 | Lyon County | 21.1 |
| #22780 | Dubuque County | 28.9 |
| #55325 | Crawford County | 26.4 |
| #46379 | Allamakee County | 27.1 |
| #84259 | Jones County | 34.2 |
Visualising Uncertainty
Department of Econometrics and Business Statistics
Spatial data takes up the two dimensions of the display leaving colour and fill to map uncertainty.
| scientistID | county_name | recorded_temp |
|---|---|---|
| #74991 | Lyon County | 21.1 |
| #22780 | Dubuque County | 28.9 |
| #55325 | Crawford County | 26.4 |
| #46379 | Allamakee County | 27.1 |
| #84259 | Jones County | 34.2 |
990 citizen scientists participated
geom_point.tibble by the additional metata in the Coordinate reference system (CRS)
| county_name | temp_mean | temp_se | n |
|---|---|---|---|
| Adair County | 29.7 | 0.907 | 6 |
| Adams County | 29.6 | 1.003 | 9 |
| Allamakee County | 26.3 | 0.550 | 8 |
| Appanoose County | 22.8 | 0.831 | 14 |
| Audubon County | 27.6 | 0.893 | 11 |
| county_name | temp_mean | low_se | high_se |
|---|---|---|---|
| Adair County | 29.7 | 0.907 | 2.72 |
| Adams County | 29.6 | 1.003 | 3.01 |
| Allamakee County | 26.3 | 0.550 | 1.65 |
One of these maps was made using the estimate with the high standard error, the other was made with the estimate from the low standard error. Can you tell which is which?
ggdibbler package as toy_temp.10:00
We are going to go through some uncertainty visualisation methods assess them on the signal suppression criteria.
Remember, uncertainty visualisation should
Reinforce justified signals
We want to trust the results
Hide signals that are primarily noise
We don’t want to see something that isn’t there
ggdibbler
Vizumap
biscale
ggdibblerggdibbler exampledistributional and ggdibbler ecosystemdistributional makes the uncertainty more explicit
temp_dist that contains the sampling distribution of temp_mean| county_name | temp_mean | temp_se | temp_dist | n |
|---|---|---|---|---|
| Adair County | 29.7 | 0.907 | N(30, 0.82) | 6 |
| Adams County | 29.6 | 1.003 | N(30, 1) | 9 |
| Allamakee County | 26.3 | 0.550 | N(26, 0.3) | 8 |
| Appanoose County | 22.8 | 0.831 | N(23, 0.69) | 14 |
| Audubon County | 27.6 | 0.893 | N(28, 0.8) | 11 |
ggplot to ggdibblerggdibblerRemember, the plot is random
ggdibblerRemember, the plot is random
Here is the code that was used to make the cartogram from earlier in the session. Using distributional and the standard error provided in toy_temp_mean, can you make a ggdibbler version of this plot?
10:00
# Transform to a the crs needed to do the cartogram transformation
toy_merc <- st_transform(toy_temp_mean, 3857)
# cartogram transformation
toy_cartogram <- cartogram_cont(toy_merc, weight = "n", itermax = 5)
# Transform back to original crs
toy_cartogram <- st_transform(toy_cartogram, st_crs(toy_temp_mean))
# Plot cartogram using ggplot2
ggplot(toy_cartogram) +
geom_sf(aes(fill = temp_mean), linewidth = 0, alpha = 0.9) +
theme_minimal() +
scale_fill_distiller(palette = "YlOrRd", direction= 1) +
xlab("Longitude") +
ylab("Latitude") +
labs(fill = "Temperature") +
theme(aspect.ratio=0.7)# only change to data is distribution
toy_cartogram |>
mutate(temp_dist = dist_normal(temp_mean, temp_se^2)) |>
ggplot() +
geom_sf_sample(aes(geometry=county_geometry,
fill=temp_dist), linewidth=0) +
geom_sf(aes(geometry=county_geometry), fill=NA, colour="white") +
theme_minimal() +
scale_fill_distiller(palette = "YlOrRd", direction= 1) +
xlab("Longitude") +
ylab("Latitude") +
labs(fill = "Temperature") +
theme(aspect.ratio=0.7)
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.