How do I interpret and explain this density plot?
I dont see how this is an R related question.
Not R, but definitely a data visualization question atleast! This was made in R, so thought to ask here.
The first thing I notice is that the title for the x legend is not really meaningful... "% old population". Therefore I wouldnt know to proceed with an interpretation
% old population is the the percentage of old people out of the total population in that particular country or region.
I dont see how that would make sense for a density plot.
What is the source of the chart ? maybe you should consult the author to ask them.
I would encourage you to think how a plot may be constructed, here is an example.
library(tidyverse)
# mycountry has a population of 12,333,541, they have ages
ages_0_a<-rnorm(1233541,mean = 60,25)
ages_0_b<-rnorm(1233541,mean = 25,5)
ages_0 <- sample(c(ages_0_a,ages_0_b),size = 1233541,replace = FALSE)
ages_1 <- ifelse(ages_0<1,1,ages_0)
ages <- ifelse(ages_1>120,sample.int(100,1),ages_1)
(my_country <- enframe(ages))
# we can plot this as a density plot, the interpretation is very natural
ggplot(data=my_country,
mapping = aes(x=value))+
geom_density()
#are we simply normalising the age range and calling it a percentage ...
ggplot(data=my_country %>% mutate(v2=100*value/max(value)),
mapping = aes(x=v2))+
geom_density()
# Finally,
# do we want to plot something about the age at percentile?
# because perhaps thats what it might mean to show how age is ditributed in a population..
# but such a chart would look entirely different, i.e. not a density chart
(my_country2 <-mutate(my_country,
prank = round(percent_rank(value),2)))
(my_country3 <- group_by(my_country2,
prank) %>% summarise(mean_v = mean(value)))
ggplot(data=my_country3,
mapping = aes(x=prank,y=mean_v))+
geom_line()
This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.
If you have a query related to it or one of the replies, start a new topic and refer back with a link.