## Basic Ratio for RTRA

1. The RTRA ratio procedure shows the relationship between two **continuous** variables. For example, this procedure can be used to calculate the ratio of income to spending by sex. To generate a ratio, call the following RTRA procedure:

**%RTRARatio**(

InputDataset=,

OutputName=,

ClassVarList=,

NumeratorVar=,

DenominatorVar=,

ByVar=,

UserWeight=);

2. **%RTRARatio** parameter definition:

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

**OutputName** = identify the output dataset name you want returned (maximum of 20 characters and the first character must be a letter).

**ClassVarList** = identify a maximum of four variables for the dimensions of the ratio procedure. These variable needs to be delimited by a space or asterisk. Each variable must contain more than one but no more than 500 unique values. This parameter may be left empty if you wish to calculate ratios for the entire population.

**NumeratorVar** = identify exactly one variable as the numerator. This variable must be of type numeric.

**DenominatorVar** = identify exactly one variable as the denominator. This variable must be of type numeric.

**ByVar** = identify exactly one variable for the ratio procedure. This variable must contain more than one but no more than 500 unique values.

**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 the ratio of total income over total number of hours worked, giving an hourly wage rate. You would like this ratio calculated for each "Province".

**%RTRARatio**(

InputDataset=work.LFS,

OutputName=Table1,

ClassVarList=,

NumeratorVar=Income,

DenominatorVar=Hours_worked,

ByVar=Province,

UserWeight=Finalwt);

The following table displays results from the example procedure above.

Province | _Ratio_ | _Count_ |
---|---|---|

27268000 | ||

ON | 9.50 | 428000 |

QC | 9.00 | 115000 |

BC | 8.00 | 784000 |

SK | 9.25 | 628000 |

MB | 9.00 | 6420000 |

AB | 8.80 | 10580000 |

NS | 8.60 | 955000 |

NL | 9.00 | 806000 |

PEI | 8.40 | 2839000 |

NB | 8.25 | 3713000 |

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

The results in this table can be read as follows:

- The total weighted population associated with the calculation of this table is equal to 27,268,000.
- The ratio of total income over total number of hours worked in Ontario equals to $9.50 per hour. The weighted population associated with this calculation is equal to 428,000.
- The ratio of total income over total number of hours worked in Quebec equals to $9.00 per hour. The weighted population associated with this calculation is equal to 115,000.
- ... etc.

## L5 Percentile for RTRA

1. This is the RTRA procedure macro for producing tabulations which include a selected Level 5 statistic. It calls the macro ProcessRequest which is the processing routine common to all RTRA procedure macros. For example, this procedure can be used to calculate the ratio of income to spending by sex. To generate a ratio, call the following RTRA procedure:

**%RTRARatioL5**(

InputDataset=,

OutputName=,

ClassVarList=,

NumeratorVar=,

DenominatorVar=,

ByVar=,

L5Stat=,

L5Type=,

L5ByVar=,

L5BaseVal=,

UserWeight=);

2. **%RTRARatioL5 **parameter definition:

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

**OutputName** = identifies the name that is to be given to the final output files corresponding to this call to RTRARatioL5. The tabulated results output data set is assigned an internally generated name rather than the name in this parameter. The post-processing parameters data set defines the correspondence between the internally generated name and the final output file names.

**ClassVarList** = identify a maximum of four variables for the dimensions of the ratio procedure. For RTRARatioL5, it is valid to omit this parameter or specify blank. Variables in the list can be separated by any number of spaces, asterisks or combination of spaces and asterisks.

**NumeratorVar** = identify exactly one variable as the numerator. This variable must be of type numeric.

**DenominatorVar** = identify exactly one variable as the denominator. This variable must be of type numeric.

**ByVar** = identify exactly one variable for the ratio procedure. This variable must contain more than one but no more than 500 unique values.

**L5Stat** = identifies the name of the Level 5 statistic. Valid values are LC, PC and ST (case insensitive).

**L5Type** = identifies the statistic type. Valid values are SEQUENTIAL, BASE and GLOBAL (case insensitive).

**L5ByVar** = identifies the Level 5 BY variable. The specified variable must either exist in <classVarList> or be the same as <byVar>.

**L5BaseVal** = identifies the Level 5 base value. This parameter is only applicable if <L5Type> is BASE and must be blank if <L5Type> is SEQUENTIAL or GLOBAL. If applicable, the specified value must exist in the variable <L5ByVar> in the input data set.

**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 analyze the evolution of household debt in Canada. You would like this ratio calculated for each "Region".

**%RTRARatioL5**(

InputDataset=work.test,

OutputName=Table2,

ClassVarList=,

NumeratorVar=AD_Q12,

DenominatorVar=assets,

ByVar=Region,

L5Stat=PC,

L5Type=global,

L5ByVar=REGION,

UserWeight=WTPM);

The following table displays results from the example procedure above. Please note that this is a section of the data in the documentation and a select few entries of the actual output have been pulled for the purpose of having smaller outputs.

Region | _Ratio_ | RATIO_PCG | _Count_ |
---|---|---|---|

Atlantic | 0.0137 | 0.45 | 13000 |

Quebec | 0.0157 | 0.66 | 66000 |

Ontario | 0.075 | -0.21 | 109000 |

Manitoba and Saskatchewan | 0.103 | 0.087 | 22000 |

Alberta | 0.122 | 0.28 | 56000 |

British Columbia | 0.064 | -0.33 | 35000 |

Canada | 0.095 | 0 | 301000 |

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

## L5SOT Percentile for RTRA

1. This is the RTRA procedure macro for producing tabulations which include a selected Level 5 sequential over time statistic. It calls the macro ProcessRequest which is the processing routine common to all RTRA procedure macros. For example, this procedure can be used to calculate the ratio of income to spending by sex. To generate a ratio, call the following RTRA procedure:

**%RTRARatioL5SOT**(

InputDataset=,

OutputName=,

ClassVarList=,

NumeratorVar=,

DenominatorVar=,

ByVar=,

L5Stat=,

L5YrVar=,

L5MonVar=,

L5QtrVar=,

L5TimeInt=,

UserWeight=);

2. **%RTRARatioL5SOT** parameter definition:

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

**OutputName** = identifies the name that is to be given to the final output files corresponding to this call to RTRARatioL5SOT. The tabulated results output data set is assigned an internally generated name rather than the name in this parameter. The post-processing parameters data set defines the correspondence between the internally generated name and the final output file names.

**ClassVarList** = identify a maximum of four variables for the dimensions of the ratio procedure. For RTRARatioL5SOT, it is valid to omit this parameter or specify blank. Variables in the list can be separated by any number of spaces, asterisks or combination of spaces and asterisks.

**NumeratorVar** = identify exactly one variable as the numerator. This variable must be of type numeric.

**DenominatorVar** = identify exactly one variable as the denominator. This variable must be of type numeric.

**ByVar** = identify exactly one variable for the ratio procedure. This variable must contain more than one but no more than 500 unique values.

**L5Stat** = identifies the name of the Level 5 statistic. Valid values are LC, PC and ST (case insensitive).

**L5YrVar** = identifies the name of the Level 5 year variable.

**L5MonVar** = identifies the Level 5 month variable. It is valid to omit this parameter or specify blank. If L5MonVar is specified then L5QtrVar must be blank or omitted.

**L5QtrVar** = identifies the Level 5 quarter variable. It is valid to omit this parameter or specify blank. If L5QtrVar is specified then L5MonVar must be blank or omitted.

**L5TimeInt** = identifies the Level 5 time interval. The value specified must be an integer greater than 0. It is valid to omit this parameter. If omitted, the default time interval is 1.

**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 analyze the change in the specific marital status of individuals in each province, based on education levels, throughout the year. You would like this ratio calculated for each "Gender".

**%RTRARatioL5SOT**(

InputDataset=work.LFS,

OutputName=Table3,

ClassVarList=EDUCATION PROVINCE,

NumeratorVar=NUM_MARSTAT,

DenominatorVar=NUM_PROV,

ByVar=NUM_SEX,

L5Stat=LC,

L5YrVar=NUM_SYEAR,

L5MonVar=NUM_SMTH,

UserWeight=FINALWT);

The following table displays results from the example procedure above. Please note that this is a section of the data in the documentation and a select few entries of the actual output have been pulled for the purpose of having smaller outputs. For this example we will only use responses from women in a relationship in Ontario who have obtained a College degree.

NUM_SMTH | _RATIO_ | RATIO_LCS | NUM_MARSTAT_COUNT |
---|---|---|---|

January | 0.073 | 0 | 1683250 |

February | 0.072 | -0.00078 | 1705750 |

March | 0.072 | -0.000024 | 1685750 |

April | 0.072 | 0.000048 | 1699250 |

May | 0.074 | 0.00158 | 1746500 |

June | 0.074 | 0.00086 | 1732750 |

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