jitter_binary | R Documentation |
Create a function to jitter the binary outcome (p89)
jitter_binary(a, jitt = 0.05)
a |
column with values of 0 or 1 |
jitt |
amount of horizontal and vertical jitter, value between 0 and .5; defaults to .05 |
From Andrew Gelman and Jennifer Hill. For use in graphs to show the quantity of variable that otherwise would be stuck on a single lines at 0 and 1. This is different from geom_jitter because it keeps all the data within the possible range of the variable, not allowing values greater than 1 or less than 0.
Takes a binary variable and randomly spreads it within 0 and 1
jitter_binary(contract$b_CBre)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.