Share for RTRA

share-rtra.pdf (PDF, 237.25 KB)

Basic Share for RTRA

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

%RTRAShare(
InputDataset=,
OutputName=,
ClassVarList=,
ShareOfVar=,
ByVar=,
UserWeight=);

2. %RTRAShare 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 be a letter).

ClassVarList = identify a maximum of four variables for the dimensions of the Share 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 Shares 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 Share 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 Share of total income over total number of hours worked, giving an hourly wage rate. You would like this Share calculated for each "Province".

%RTRAShare(
InputDataset=work.LFS,
OutputName=Table1,
ClassVarList=,
ShareOfVar=Income,
ByVar=Province,
UserWeight=Finalwt);

The following table displays results from the example procedure above.

Table 1
Results from example procedure
Province _Share_ _Count_
    27268000
ON 0.0183 428000
QC 0.0041 115000
BC 0.028 784000
SK 0.021 628000
MB 0.197 6420000
AB 0.4 10580000
NS 0.036 955000
NL 0.034 806000
PEI 0.117 2839000
NB 0.149 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.
  • Ontario's share of total income in Canada is equal to 1.83 %. The weighted population associated with this calculation is equal to 428,000.
  • Quebec's share of total income in Canada is equal to 0.41%. The weighted population associated with this calculation is equal to 115,000
  • ... etc.

L5 Share for RTRA

1. This is the RTRA procedure macro for producing Share tabulations which include a selected Level 5 statistic. For example, this procedure can be used to calculate the share of total income earned by province. To generate share tabulations, call the following RTRA procedure:

%RTRAShareL5(
InputDataset=,
OutputName=,
ClassVarList=,
ShareOfVar=,
ByVar=,,
L5Stat=,,
L5Type=,,
L5ByVar=,
L5BaseVal=,,
UserWeight=),

2. %RTRAShareL5 parameter definition:

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

OutputName = identify the name that is to be given to the final output files corresponding to this call to RTRAShareL5. The tabulated results 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 generates name and the final output file names.

ClassVarList = identify a maximum of four variables for the dimensions of the share procedure. For RTRAShareL5, 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.

ShareOfVar = identify exactly one variable for the share procedure. This variable must be numeric. The share will be calculated on this continuous variable.

ByVar = identify exactly one variable for the share procedure. This variable must contain more than one but no more than 500 unique values and is appended to the class variable list in CreateEngineXML.

L5Stat = identifies the name of the Level 5 statistic. Valid values are LC 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 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 = 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: This procedure can be used to calculate the share of mortgage payments by family type, calculated by total income. Suppose you ran the following RTRA procedure to calculate a share of variable called "mtgpmts" which refers to "mortgage payments". You would like this share to be calculated for a variable called "Income".

%RTRAShareL5(
InputDataset=work.family1,
OutputName=Table2,
ClassVarList=,
ShareOfVar=mtgpmts,
ByVar=Income,
L5Stat=ST,
L5Type=Global,
L5ByVar=Income
UserWeight=weight);

The following table displays results from the example procedure above.

Table 2
Results from example procedure
Income _Share_ Share_STG _Count_
Less than $23,200 0.029 -1 2920500
$23,200 to $41,325 0.082 -1 2872500
$41,325 to $61,200 0.165 -1 2896000
$61,200 to $91,675 0.31 -1 2948000
More than $91,675 0.41 -1 2933000
Note: output for surveys with bootstrap weights will have additional information on precision measures i.e. quality indicators, standard errors, confidence intervals, etc.

L5SOT Share for RTRA

1. This is the RTRA procedure macro for producing Share tabulations which include a selected Level 5 Sequential Over Time (L5SOT) statistic. For example, this procedure can be used to calculate the share of total income earned by province. To generate share tabulations, call the following RTRA procedure:

%RTRAShareL5SOT(
InputDataset=,
OutputName=,
ClassVarList=,
ShareOfVar=,
ByVar=,
L5Stat=,
L5YrVar=,
L5MonVar=,
L5QtrVar=
L5TimeInt=,
UserWeight=)

2. %RTRAShareL5SOT parameter definition:

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

OutputName = identify the name that is to be given to the final output files corresponding to this call to RTRAShareL5SOT. The tabulated results 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 generates name and the final output file names.

ClassVarList = identify a maximum of four variables for the dimensions of the share procedure. These variables need to be delimited by spaces or asterisks. It is valid to omit this parameter or specify blank.

ShareOfVar = identify exactly one variable for the share procedure. This variable must be numeric. The share will be calculated on this continuous variable.

ByVar = identify exactly one variable for the share procedure. This variable must contain more than one but no more than 500 unique values and is appended to the class variable list in CreateEngineXML.

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

L5YrVar = identifies the Level 5 year variable.

L5MonVar = (optional) identifies the Level 5 month variable. Valid to omit this parameter or specify blank. If L5MonVar is specified then L5 QtrVar 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: This procedure can be used to calculate the share of hours by level of education, calculated by province. Suppose you ran the following RTRA procedure to calculate a share of the hours variable called "HOURS". You would like this share to be calculated for a variable called "EDUCATION".

%RTRAShareL5SOT(
InputDataset=work.LFS,
OutputName=ShareOfHours,
ClassVarList=PROVINCE,
ShareOfVar=HOURS,
ByVar=EDUCATION,
L5Stat=LC,
L5YrVar=YEAR,
L5ByVar=MONTH,
UserWeight=FINALWT);

The following table displays results from the example procedure above.

Table 3
Results from example procedure
YEAR MONTH PROVINCE EDUCATION _SHARE_ SHARE_LC HOURS_COUNT
2015 January Ontario   1   6767750
2015 January Ontario College 0.35   2291500
2015 January Ontario High school 0.25   1806000
2015 January Ontario Less than high school 0.068   537750
2015 January Ontario University 0.33   2132500
2015 February Ontario   1 0 6802000
2015 February Ontario College 0.36 0.0048 2333000
2015 February Ontario High school 0.25 -0.0032 1788000
2015 February Ontario Less than high school 0.066 -0.0023 529250
2015 February Ontario University 0.33 0.00076 2151750
2015 March Ontario   1 0 6781250
2015 March Ontario College 0.35 -0.0028 2305750
2015 March Ontario High school 0.25 0.0034 1791500
2015 March Ontario Less than high school 0.065 -0.00062 528750
2015 March Ontario University 0.33 9.00E-06 2155250
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: