|
Size: 822
Comment:
|
Size: 787
Comment:
|
| Deletions are marked like this. | Additions are marked like this. |
| Line 21: | Line 21: |
| a <- rep(-99,length(score)) | |
| Line 24: | Line 23: |
| for (ict in 1:length(score) { | |
| Line 25: | Line 25: |
| perc[i] <- 100*sum(score<=i)/length(score) | perc[ict] <- 100*sum(score<=i)/length(score) |
| Line 27: | Line 27: |
| if (b[i] == FALSE) { a[i] <- score[ict] } |
} |
| Line 32: | Line 30: |
| a | score |
How do I find out how many people have a score above a certain value?
Percentiles give the percentage of people who have a score below a threshold score.
Percentile (score) = 100 $$\frac{\mbox{n} \leq \mbox{score}}{\mbox{N}}$$
100 - Percentile (score) = 100 $$\frac{\mbox{n} \gt \mbox{score}}{\mbox{N}}$$
The percentiles for each score are routinely outputted using the frequency procedure in SPSS.
FREQUENCIES VAR=SCORE. EXE.
In R the percentages of people with scores equal or below each observed score can be obtained by running
perc <- rep(-99,length(score))
ict <- 1
b <- duplicated(score)
for (ict in 1:length(score) {
for (i in score) {
perc[ict] <- 100*sum(score<=i)/length(score)
ict <- ict+1
}
}
perc
score