Download the DOC version (DOC, 36 KB)

1. A percentile is the value of a variable below which a certain percent of observations fall. For example, the RTRA percentile procedure can be used to find the median income for males and females. To calculate percentiles, call the following RTRA procedure:

**%RTRAPercentile (**

InputDataset=,

OutputName=,

ClassVarList=,

AnalysisVar=,

Percentiles=,

UserWeight=);

2. **%RTRAPercentile** parameter definition:

**InputDataset** = identify the input data set from the WORK area to be used by the procedure.

**OutputName** = identify the name of the output files you want returned (maximum of 20 characters and the first character must not be an underscore).

**ClassVarList** = identify a maximum of five variables for the dimensions of the percentile procedure. These variables need to be delimited by spaces or asterisks. Each variable must contain more than one but no more than 500 unique values.

**AnalysisVar** = identify exactly one variable for the percentile procedure. This variable must be of type numeric.

**Percentiles** = identify up to three percentiles from the following list: 1, 5, 10, 20, 25, 30, 40, 50, 60, 70, 75, 80, 90, 95, 99. The percentile values need to be delimited by spaces.

**UserWeight** = refer to the RTRA parameters document to identify a survey weight. The weight variable identified will be merged onto the input data set using the ID variable.

3. Example: This procedure can be used to calculate income percentiles. Suppose you ran the following RTRA procedure to calculate the first quartile, the median, and the third quartile of a variable called “Income” to generate a table named “Table1”. You would like to calculate these percentiles for each gender using a variable called “Sex”.

Your RTRA procedure call will look like this:

**%RTRAPercentile (**

InputDataset=work.LFS,

OutputName=Table1,

ClassVarList=Education Sex,

AnalysisVar=Income,

Percentiles=25 50 75,

UserWeight=Finalwt);

The following table displays results from the example procedure above.

Sex | Income_P25 | Income_P50 | Income_P75 | Income_Count |
---|---|---|---|---|

20000 | 45000 | 110000 | 27268000 | |

Female | 28000 | 50000 | 100000 | 13448000 |

Male | 16000 | 38000 | 620000 | 13820000 |

Note: Note, output for surveys with bootstrap weights will have additional information on precision measures i.e. quality indicators, standard errors, confidence intervals, etc. |