kipp_quartile: Calcualte KIPP Foundation style quartiles from percentile...

Description Usage Arguments Details Value Examples

Description

kipp_quartile returns an integer or factor vector quartiles.

Usage

1
kipp_quartile(x, return.factor = TRUE, proper.quartile = FALSE)

Arguments

x

vector of percentiles to be converted to quartiels

return.factor

default is TRUE. If set to FALSE returns integers rather than factors.

proper.quartile

defaul is FALSE. If set to TRUE returns traditional quartiles rather then KIPP Foundation quartiles.

Details

This function calculates the KIPP Foundation's (kinda fucked up) quartile (i.e., the foundation breaks with stanard mathematical pracitce and puts the 50th percenile in the 3rd rather than the 2nd quartile). It takes a vector of percentiles and translates those into quartiles, where the 25th, 50th, and 75th percentils are shifted up into the 2nd, 3rd, and 4th quartiles, respectively. You can revert to a traditional quartile calculation by setting the proper.quartile argument to TRUE.

Value

a vector of length(x).

Examples

1
2
3
4
x <- sample(x=1:99, 100,replace = T)
kipp_quartile(x)
kipp_quartile(x, proper.quartile=TRUE)
kipp_quartile(x, proper.quartile=TRUE, return.factor=FALSE)

almartin82/MAP-visuals documentation built on May 10, 2019, 9:24 a.m.