You can easily extend to provide additional information concerning out-ofrange values. To do this, you use two alternate missing values,namely .H and .L. The use of numeric missing values other than a single period (.) is another underused SAS System feature.Besides the single period that specifies a missing value, there are 27 additional missing value designations:._ (that's a period followed by an underscore) and .A through .Z. In this example, you use separate missing values to represent high and low out-of-range values.You are then able to produce counts of these out-of-range values, and at the same time, you are able to compute statistics without including them. Here is the program:
The output from this program follows.
Output from Example - Checking Ranges for Numeric Variables
You conveniently choose .H and .L as the special missing values for high and low out-ofrange values.1 You alternatively could have chosen any of the 27 available missing values such as .A and .B to represent the low and high values. Values in the valid ranges are untouched because you specify _SAME_ for your informatted value.
In the PROC FORMAT code,you also use a VALUE statement © to create an output format so that you can label the appropriate missing values. You use this format to label the variables SBP and DBP in the PROC FREQ output, but not in the PROC PRINT listing 0,so that you can see the actual "internal" values stored in the SAS data set. Note that the missing SBP value for ID number 004 is truly missing, whereas the out-of-range missing values are stored as the appropriate special missing values.
In this example,you use the MISSING and NOCUM options 0 on the TABLES statement of PROC FREQ.Without the missing option, the missing values would only be noted at the bottom of the table in the form Frequency Missing = .When the MISSING option is specified, the missing value(s) are listed in the body of the frequency table, and the frequencies and percentages are calculated based on all the observations, including the ones with missing values. You use the NOCUM option to eliminate the Cumulative Frequency and the Cumulative Percent columns.
PROC MEANS is run to demonstrate that no distinction is made between different missing values when statistical calculations are made. A missing value by any other name is still missing.
SAS Programming Related Tutorials
|SASS (Syntactically Awesome Style sheets) Tutorial||R Programming language Tutorial|
SAS Programming Related Interview Questions
|Logistics Interview Questions||SAS Programming,SQL server Interview Questions|
|Clinical SAS Interview Questions||SASS (Syntactically Awesome Style sheets) Interview Questions|
|SQL Server Analysis Services (SSAS) Interview Questions||R Programming language Interview Questions|
|SAS DI Interview Questions||Advanced SAS Interview Questions|
|Base Sas Interview Questions||SAS Macro Interview Questions|
|Clinical Data Management Interview Questions|
Sas Programming Tutorial
Input And Infile
Set, Merge, And Update
Table Lookup Tools
Proc Means And Proc Uimivariate
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.