kjhealy / lexis_surface

8 stars 2 forks source link

Inclination of the graph #1

Closed syldor closed 5 years ago

syldor commented 5 years ago

Thank you for your code and a great visualization. In the blog post, the graph shows up as having a rectangle shape selection_500

when in this code it's more of a diamond shape.

britain_men

How is the correction made and what does it mean?

I feel like I'm not grasping what is actually plotted.

kjhealy commented 5 years ago

I can't reproduce this. Assuming you have the right data from mortality.org, and it's loaded as at the top of lexis.r, this code:

p_out <- p + geom_raster() +
    scale_fill_viridis_c(option = "A", direction = -1) +
    scale_x_continuous(breaks = seq(1845, 2015, by = 15)) +
    ylim(c(0, 100)) +
    guides(fill = guide_legend(nrow = 1, title.position = "top", label.position = "bottom")) +
    labs(x = "Year", y = "Age", fill = "Male Death Rate Percentile",
         title = "Male Mortality Rates in England and Wales, 1841-2016",
         subtitle = "Binned by percentile",
         caption = "@kjhealy / http://socviz.co. Data: Human Mortality Database.") +
    theme(legend.position = "top",
          legend.title = element_text(size = 8))

p_out

Should give you this figure:

screen shot 2019-01-04 at 7 40 07 am
syldor commented 5 years ago

Damn, I was plotting the cohort mortality rate instead of the periodic one. Thank you for your answer :)

syldor commented 5 years ago

I have another question. What do you mean by

If you plot the raw mortality rates, what you’ll find is that the wars tend to drown out all the other data in the series, washing out the other trends.

I understand that when we plot the raw mortality rates we only see two patterns appearing:

selection_501

And I understand that because we cannot see the other trends from your article you decided to take a different "lens" by doing the binning, but why are the war responsible for that?

(I'm really just asking because I find the article amazing and try to fully grasp it and not because I'm looking for issues :))