Learn R Programming

radiant.data (version 0.6.0)

xtile: Create a quintile (or decile) index

Description

Create a quintile (or decile) index

Usage

xtile(x, n, rev = FALSE)

Arguments

x
Numeric variable
n
number of bins to create
rev
Reverse the order of the xtiles

Details

Same as stata

Examples

Run this code
xtile(1:10,5)
xtile(1:10,5, rev = TRUE)

Run the code above in your browser using DataLab