2025-02-27
Figure 1 from Dwyer-Lindgren et al. (2024)
Figure 1 from Dwyer-Lindgren et al. (2024)
Available through March 2
Figure 1
data.frame()
) is a useful way to store tidy data sample_name value
1 x0 -0.2215727
2 x0 0.7239627
3 x0 1.0537225
4 x0 1.4285979
5 x0 -2.1792573
6 x0 -1.0780997
sample_name value
195 x1 -0.5821572
196 x1 -0.2016177
197 x1 0.9861709
198 x1 -0.5459307
199 x1 0.9408583
200 x1 1.6810159
Note
data.frame()
: makes a rectangular table of data with labeled columns.
rep()
: replicates or repeats its arguments. So rep('x0', 100)
makes a vector/array with 100 copies of ‘x0’.
We use value = c(x0, x1)
to combine x0 and x1 into one long set of values.
Wait!: You said don’t use the equal sign (=
), but use it here. What gives? Long-story shortened: The equal sign (=
) only works when we’re defining parameters inside a function; the left arrow (<-
) does not. So, use left arrows for assigning names outside a function and equal signs inside functions.
Syntax is kind of a pain. Remember when you had to learn English grammar?
Figure 4
Figure 5: Mean + 1 standard deviation
Figure 6: Mean + 1 standard error of the mean
Figure 7: Mean + 1 standard deviation + jittered points
Figure 8: Mean + 1 standard error of the mean + jittered points
Linear fit with sd=.5
Linear fit with sd=.75
Linear fit with sd=1
Linear fit with sd=1.5
Linear fit with independent unrelated variables
Risk recall was significantly higher with more anthropomorphic icons (restroom icons, head outlines, and photos) than with other icon types, and participants rated restroom icons as most preferred. However, while restroom icons resulted in the highest correlations between perceived and actual risk among more numerate/graphically literate participants, they performed no better than other icon types among less numerate/graphically literate participants.
Zikmund-Fisher et al. (2014)
“Rate of measles cases and deaths in the united states, 1919 to 2024” (n.d.)
DataCamp status as of 2025-02-26-1534
More Slow-R