Created
July 21, 2020 21:34
-
-
Save randrescastaneda/1311efea70a178b95d8ed47e80d925b7 to your computer and use it in GitHub Desktop.
Create quantiles based on size of sample (This is not the same as percentiles)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
qtile <- function(x, nq = 10) { | |
N <- length(x) | |
csw <- 1:N | |
qp <- floor(csw/((N+1)/nq)) + 1 | |
return(qp) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment