Submitted by IndeterminateYogurt t3_zzp93v in dataisbeautiful
virtuouspapaya t1_j2cx9v9 wrote
Very interesting! Would also be interesting to do analysis by these regions. I can tell by looking at the graph that a much higher percentage of the Middle Eastern countries are above the threshold than in Africa.
IndeterminateYogurt OP t1_j2czj55 wrote
Same graph with labels removed and lin. regressions for country groups, if thats what you mean? a bit messy tho.
MMAgeezer t1_j2dhw56 wrote
Can you do that again with log-log transformations in the linear regression, to match the plot and idea behind using this kind of plot? Thanks!
IndeterminateYogurt OP t1_j2dkrsx wrote
I used this:
# geom_smooth(
# method = "glm",
# formula = y ~ x,
# method.args = list(family = gaussian(link = 'log')),
is that not how to do a log-log-transformation in ggplot2? So far haven't worked with a lot of log-scaled data
EDIT: ah, seems to only log y. That explains the curvature.
MMAgeezer t1_j2dqnod wrote
Actually, if the plot is already using transformed data inside the ‘aes()’ call, then you should be able to just use this if I’m not mistaken:
> geom_smooth(formula = y ~ x, method='lm')
[deleted] t1_j2dhop6 wrote
[deleted]
Viewing a single comment thread. View all comments