Diff for "FAQ/perc" - CBU statistics Wiki
location: Diff for "FAQ/perc"
Differences between revisions 13 and 21 (spanning 8 versions)
Revision 13 as of 2008-04-11 11:57:21
Size: 913
Editor: PeterWatson
Comment:
Revision 21 as of 2013-03-08 10:17:13
Size: 774
Editor: localhost
Comment: converted to 1.6 markup
Deletions are marked like this. Additions are marked like this.
Line 10: Line 10:
The percentiles for each score are routinely outputted using the frequency procedure in SPSS. The score percentiles can be obtained by running the below in SPSS.
Line 17: Line 17:
In R the percentages of people with scores equal or below each observed score can be obtained by running or the below in R:
Line 20: Line 20:
score <- sort(score)
Line 21: Line 22:
a <- rep(-99,length(score))
cc <- rep(-99,length(score))
ict <- 0
kct <- 0
ict <- 1
Line 26: Line 24:
for (ict in 1:length(score) {
for (i in score) {
perc[ict] <- 100*sum(score<=i)/length(score)
Line 27: Line 28:
for (i in score) {
perc[i] <- 100*sum(score<=i)/length(score)
a[i] <- score[i]
kct <- kct+1
if (b[i] == TRUE) {
ict <- ict+1
a[ict] <- score[kct]
}
Line 35: Line 30:
 }
perc
a
cc
(percu <- perc[!duplicated(perc)])
(scoreu <- score[!duplicated(score)])
percu
scoreu

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 score percentiles can be obtained by running the below in SPSS.

FREQUENCIES VAR=SCORE.
EXE.

or the below in R:

score <- sort(score)
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
}
 }
(percu <- perc[!duplicated(perc)])
(scoreu <- score[!duplicated(score)])
percu
scoreu

None: FAQ/perc (last edited 2013-03-08 10:17:13 by localhost)