Here are my reproducible data:
library("ggplot2") library("ggplot2movies") library("quantreg") set.seed(2154) msamp <- movies[sample(nrow(movies), 1000), ]
I am trying to get acquainted with stat_quantile , but in the example from the documentation a few questions arise.
mggp <- ggplot(data=msamp, mapping=aes(x=year, y=rating)) + geom_point() + stat_quantile(formula=y~x, quantiles=c(0, 0.25, 0.50, 0.75, 1)) + theme_classic(base_size = 12) + ylim(c(0,10)) mggp
As far as I understand, the quantile broke the data into parts that are less than the specified cutoff values, right? If I define quantiles, as in the following code, I get five lines. What for? What do they represent?
Quantiles seem to be calculated based on a dependent variable along the y axis (rating). Can this be undone? I want to break quantile data into "year"?
source share