Proportions for RTRA
proportions-rtra.pdf (PDF, 224.36 KB)
Basic Proportions for RTRA
1. The RTRA proportion procedure calculates the population distribution of a discrete variable. For example, this procedure can be used to calculate the proportion of the population living with asthma. To generate a proportion, call the following RTRA procedure:
%RTRAProportion(
InputDataset=,
OutputName=,
ClassVarList=,
ByVar=,
UserWeight=);
2. %RTRAProportion 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 four variables for the dimensions of the proportion 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. This parameter may be left empty if you wish to calculate a proportion for the entire population.
ByVar = identify exactly one variable for the proportion procedure. This variable must contain more than one but no more than 500 unique values. Your population distribution will be calculated on this discrete variable.
UserWeight= refer to the RTRA parameters document to identify a survey weight. The weight variable identified will be merged to the InputDataset using the ID variable.
3. Example: This procedure can be used to calculate the proportion of population living with asthma. Suppose you ran the following RTRA procedure to calculate a proportion of a variable called "Asthma" to generate a table named "Table1". You would like to calculate this proportion for each gender using variable called "Sex".
%RTRAProportion(
InputDataset=work.CCHS,
OutputName=Table1,
ClassVarList=Sex,
ByVar=Asthma,
UserWeight=Finalwt);
The following table displays results from the example procedure above.
Sex | Asthma | _Proportion_ | _Count_ |
---|---|---|---|
200 | |||
Yes | 0.10 | 20 | |
No | 0.90 | 180 | |
Female | 110 | ||
Female | Yes | 0.09 | 10 |
Female | No | 0.91 | 100 |
Male | 90 | ||
Male | Yes | 0.11 | 10 |
Male | No | 0.89 | 80 |
L5 Proportions for RTRA
1. This is the RTRA procedure macro for producing Proportion tabulations which include a selected Level 5 statistic. The RTRA proportion procedure calculates the population distribution of a discrete variable. For example, this procedure can be used to calculate the proportion of the population living with asthma. To generate a proportion, call the following RTRA procedure:
%RTRAProportionL5(
InputDataset=,
OutputName=,
ClassVarList=,
ByVar=,
L5Stat=,
L5Type=,
L5ByVar=,
L5BaseVal=,
UserWeight=);
2. %RTRAProportionL5 parameter definition:
InputDataset = identify the input data set from the WORK area to be used by the procedure.
OutputName = identify the name that is given to the final output files corresponding to this call to RTRAProportionL5. The tabulated results output data set is assigned an internally generates 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 proportion procedure. For RTRAProportionL5, 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.
ByVar = identifies the name of the BY variable and is used as the share variable. It is also 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 proportion of the population that has had a particular medical procedure completed.
Your RTRA procedure call will look like this:
%RTRAProportionL5(
InputDataset=work.ccs_asy,
OutputName=Table2,
ClassVarList=DHH_SEX,
byVar=either_sc,
L5Stat=LC,
L5Type=sequential,
L5ByVar=either_sc,
UserWeight=wts_m);
The following table displays results from the example L5 Proportions procedure above. For this example, either_sc refers to a "yes" or "no" answer as to whether or not an individual has had the particular medical procedure. 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.
DHH_SEX | EITHER_SC | PROPORTION | PROPORTION_LCS | COUNT |
---|---|---|---|---|
Male | Yes | 0.52 | 0.044 | 10500 |
Male | Yes | 0.4 | -0.194 | 50500 |
Male | No | 0.63 | 0 | 43000 |
Male | No | 0.48 | 0 | 9750 |
Female | Yes | 0.27 | -0.46 | 21250 |
Female | Yes | 0.48 | -0.041 | 9750 |
Female | No | 0.73 | 0 | 57250 |
Female | No | 0.52 | 0 | 10750 |
L5SOT Proportions for RTRA
This is the RTRA procedure macro for producing Proportion tabulations which include a selected Level 5 Sequential Over Time (L5SOT) statistic. The RTRA proportion procedure calculates the population distribution of a discrete variable. For example, this procedure can be used to calculate the proportion of the population living with asthma. To generate a proportion, call the following RTRA procedure:
%RTRAProportionL5SOT(
InputDataset=,
OutputName=,
ClassVarList=,
ByVar=,
L5Stat=,
L5YrVar=,
L5MonVar=,
L5QtrVar=,
L5TimeInt=,
UserWeight=);
2. %RTRAProportionL5SOT parameter definition:
InputDataset = identify the input data set from the WORK area to be used by the procedure.
OutputName = identify the name that is given to the final output files corresponding to this call to RTRAProportionL5SOT. The tabulated results output data set is assigned an internally generates 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 proportion 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. It is valid to omit this parameter or specify blank.
ByVar = identifies the name of the BY variable and is used as the share variable. It is also appended to the class variable list in CreateEngineXML.
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.
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 to the InputDataset using the ID variable.
3. Example: This procedure can be used to calculate the proportion of the population that has had a particular medical procedure completed.
Your RTRA procedure call will look like this:
%RTRAProportionL5SOT(
InputDataset=work.ccs_asy,
OutputName=Table3,
ClassVarList=DHH_SEX,
L5Stat=LC,
L5YrVar=ADM_YOI,
L5MonVar=ADM_MOI,
L5TimeInt=3,
UserWeight=wts_m);
The following table displays results from the example procedure above. In particular we are able to determine the "Sequential Over Time" proportion change between months based on various Genders. 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.
ADM_YOI | ADM_MOI | SEX | _COUNT_ | PROPORTION_LCS |
---|---|---|---|---|
2012 | March | Male | 178250 | |
April | Male | 319000 | 0.151 | |
May | Male | 235000 | 0.021 | |
June | Male | 164750 | 0.058 | |
March | Female | 220000 | ||
April | Female | 251250 | 0.061 | |
May | Female | 276500 | -0.041 | |
June | Female | 144500 | 0.02 |
- Date modified: