Viewing a single comment thread. View all comments

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.

2

IndeterminateYogurt OP t1_j2czj55 wrote

3

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!

2

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.

2

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')

1