Frequency for RTRA
frequency-rtra.pdf (PDF, 221.42 KB)
Basic Frequency for RTRA
1. The RTRA frequency procedure provides counts of a discrete variable. For example, this procedure can be used to calculate the number of people in the population by different education levels and gender. To generate frequency tabulations, call the following RTRA procedure:
%RTRAFreq(
InputDataset=,
OutputName=,
ClassVarList=,
UserWeight=);
2. %RTRAFreq 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 be a letter).
ClassVarList = identify a maximum of five variables to be included on the frequency table. These variables need to be delimited by spaces or asterisks. Each 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: Suppose you ran the following RTRA procedure to generate a frequency table named "Table1" with variables called "Education" and "Sex".
Your RTRA procedure call will look like this:
%RTRAFreq(
InputDataset=work.LFS,
OutputName=Table1,
ClassVarList=Education Sex,
UserWeight=Finalwt);
The following table displays results from the example procedure above.
Education | Sex | Count |
---|---|---|
Female | 100 | |
Male | 100 | |
Above high school | Female | 60 |
Above high school | Male | 55 |
Below high school | Female | 40 |
Below high school | Male | 45 |
Note: Output for surveys with bootstrap weights will have additional information on precision measures i.e. quality indicators, standard errors, confidence intervals, etc. |
L5 Frequency for RTRA
1. This is the RTRA procedure macro for producing Frequency (sum of weight) tabulations which include a selected Level 5 statistic. RTRAFreqL5 is a wrapper macro. 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 specific L5 (Level Change) between various Educations for individuals in each Province. To generate the year frequency tabulations, call the following RTRA procedure:
%RTRAFreqL5(
InputDataset=,
OutputName=,
ClassVarList=,
L5Stat=,
L5Type=,
L5ByVar=,
L5BaseVal=,
UserWeight=);
2. %RTRAFreqL5 parameter definition:
InputDataset = identify the input data set from the WORK area to be used by the procedure.
OutputName = identify the name given to the final output files corresponding to this call to RTRAFreqL5. Tabulated results are 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. Post-processing is then responsible for creating the final output files name.
ClassVarList = identify a maximum of five variables to be included on the frequency table. Variables in the list can be separated by any number of spaces, asterisks or combination of spaces and asterisks.
L5Stat = identifies the name of the Level 5 statistic. Valid values are LC, PC and ST (case insensitive).
L5Type = identifies the Level 5 statistic type. Valid values are SEQUENTIAL, BASE and GLOBAL (case insensitive).
L5ByVar = identifies the Level 5 BY variable. The specified variable must exist in <classVarList>.
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 = the survey weight variable (and bootstrap weight variables if they exist) is located in a weights data set in the RTRA data library. The name of the weights data set is the same as the name of the survey weight variable that it contains.
3. Example: Suppose you ran the following RTRA procedure to generate an L5 frequency table named "Table2" with variables called "Education" and "Province" using the L5YrVar.
Your RTRA procedure call will look like this:
%RTRAFreqL5(
InputDataset=work.LFS,
OutputName=Table2,
ClassVarList=province education,
L5Stat=LC,
L5Type=global,
L5ByVar=province,
L5BaseVal=,
UserWeight=FINALWT);
The following table displays results from the Level 5 Frequency 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.
EDUCATION | PROVINCE | _COUNT_ | COUNT_LCG |
---|---|---|---|
College | Manitoba | 3321500 | -108137000 |
College | Ontario | 40167000 | -71291500 |
College | Other | 67970000 | -43488500 |
High School | Manitoba | 3702250 | -92634500 |
High School | Ontario | 38880000 | -57456750 |
High School | Other | 53754500 | -42582250 |
University | Manitoba | 2531750 | -81162500 |
University | Ontario | 36012500 | -47681750 |
University | Other | 45150000 | -38544250 |
Note: Output for surveys with bootstrap weights will have additional information on precision measures i.e. quality indicators, standard errors, confidence intervals, etc. |
L5SOT Frequency for RTRA
1. This is the RTRA procedure macro for producing Frequency (sum of weight) tabulations which include a selected Level 5 Sequential Over Time (L5SOT) statistic. RTRAFreqL5SOT is a wrapper macro. 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 specific L5 (Level Change) between various Educations for individuals in each Province. To generate the year frequency tabulations, call the following RTRA procedure:
%RTRAFreqL5SOT(
InputDataset=,
OutputName=,
ClassVarList=,
L5Stat=,
L5YrVar=,
L5MonVar=,
L5QtrVar=,
L5TimeInt=,
UserWeight=);
2. %RTRAFreqL5SOT 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 corresponding to this call to RTRAFreqL5SOT. Tabulated results are 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. Post-processing is then responsible for creating the final output files name.
ClassVarList= identify a maximum of five variables to be included on the frequency table. Variables in the list can be separated by any number of spaces, asterisks or combination of spaces and asterisks.
L5Stat = identifies the name of the Level 5 statistic. Valid values are LC, PC and ST (case insensitive).
L5YrVar= identifies the Level 5 year variable. If the L5MonVar or L5QtrVar are not used, this field should reference a variable that contains multiple years to demonstrate the "Sequential Over Time" factor.
L5MonVar = (optional) identifies the Level 5 month variable. Valid to omit this parameter or specify blank. If L5MonVar is specified then L5QtrVar must be blank or omitted.
L5QtrVar = (optional) identifies the Level 5 quarter variable. Valid to omit this parameter or specify blank. If L5 QtrVar is specified then L5MonVar must be blank or omitted.
L5TimeInt= (optional) identifies the Level 5 time interval. Value specified must be an integer greater than 0. Valid to omit this parameter but default integer must be 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: Suppose you ran the following RTRA procedure to generate an L5 frequency table named "Table3" with variables called "Education" and "Province" using the L5YrVar.
Your RTRA procedure call will look like this:
%RTRAFreqL5SOT(
InputDataset=work.LFS,
OutputName=Table3,
ClassVarList=Province Education,
L5Stat=LC,
L5YrVar=NUM_SYEAR,
L5MonVar=NUM_SMTH,
L5TimeInt=1,
UserWeight=FINALWT);
The following table displays results from the example procedure above. In particular we are able to determine the "Sequential Over Time" frequency change between months based on various Provinces and Education levels. 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.
NUM_SYEAR | NUM_SMTH | EDUCATION | PROVINCE | _COUNT_ | COUNT_LCS |
---|---|---|---|---|---|
2015 | January | College | Manitoba | 275000 | |
February | College | Manitoba | 270500 | -4500 | |
March | High School | Ontario | 3339750 | ||
April | High School | Ontario | 3316500 | -23250 | |
May | University | Other | 3680500 | ||
June | University | Other | 3714750 | 34250 | |
Note: Output for surveys with bootstrap weights will have additional information on precision measures i.e. quality indicators, standard errors, confidence intervals, etc. |
- Date modified: