I need to know how to filter a dataframe so that only the results belonging to quantile 3 (Q3, 0.75) appear in some specific columns. I will try to explain myself. I have the following dataframe:
https://drive.google.com/file/d/1blYWBXCrXpH37Wz4r0mVJGbwFsdesGi-/view?usp=sharing
I need the code to returns a table with all the columns, and with all the rows that meet the condition of being in Q3 (0.75) of the following columns:
educ, salario, salini, tiempemp, expprev
Any ideas? Thanks to everyone beforehand!
I have temporarily resolved the issue by calculating the quantiles manually and doing conditional filtering as I show below. Would there be any way to improve this solution?:
quantile(empleados$educ, .75)
quantile(empleados$salario, .75)
quantile(empleados$salini, .75)
quantile(empleados$tiempemp, .75)
quantile(empleados$expprev, .75)
data.frame(empleados)
arrange(filter(empleados, educ >= 12, salario >= 28500, salini >= 14250, tiempemp >= 88, expprev >= 122.25, salario))
ok <- arrange(filter(empleados, educ >= 12, salario >= 28500, salini >= 14250, tiempemp >= 88, expprev >= 122.25, salario))
View(ok)