|Type of Tool||SAS Macro|
|Description|| This set of Macros categorizes variables from a dataset as continuous, discrete or dates. The following five variable lists are created and saved in macro variables for the user.|
1. Dates : list of variables formatted as dates.
2. Discrete : list of variables with integer values based on your specification by the parameter “maxcat” in the program. For example if you specify maxcat=8, then variables that have 8 or fewer unique values in the data are determined to be a discrete variable.
3. Continuous : list of variables with real values, or with a greater number integer values than the cutoff as defined by the parameter “maxcat”.
4. CharDiscr : List of discrete character variables.
5. Characters : List of non-discrete character variables.
This set of macros also captures the number of discrete variables and number of continuous variables.
The macro variables generated from the categorize macro can easily be fed into SAS procedures such as PROC MEANS and PROC FREQ to generate summary statistics and frequencies in accordance with the variable types.
|Classification Graph Type|
|Data||Rochester_Categorize_Download Sample Data|
|Macro Parameters|| dataset : name of SAS dataset to use.|
maxcat: maximum # of unique values for a discrete variable.
discrete : List of variables with <=N unique values.
continuous: List of variables with >N unique values.
dates : List of variables formatted as dates.
CharDiscr: List of discrete character variables with <=N unique values.
Characters: List of non-discrete character variables with >N unique values.
Ndiscrete: Number of discrete numeric variables.
Ncontinuous : Number of continuous numeric variables.
|R-Code - Attachment|
|SAS-Code - Attachment||Rochester_Categorize Macro|
|Stata-Code - Attachment|
|Other Code - Attachment|
|Called Data Manipulation|
|Called Checking Macro|
|Revision-Date||Rev 3 - Mar 29, 2010|
|Example Code||SAS Example Code|
|Example Output||SAS Example Output|
|SAS_Example_Code||Rochester_Categorize_SAS Example Code|
|SAS_Example_Output||Rochester_Categorize_SAS Example Output Sample List [[https://www.ctspedia.org/wiki/pub/CTSpedia/CategorizeEX/sampledata.htm][Rochester_Categorize_ SAS Example Output]|
|Special Features Attached|
|Special Features Text|
|Notes1-Legend||Section with calls to needed macros|
|Notes1|| filename Cate URL "http://ctspedia.org/twiki/pub/CTSpedia/CategorizeEX/Categorize.sas";|
|Notes2-Legend||Macro call with fully specified parameters|
|Notes3-Legend||Section with definitions of global macro parameters|
|Notes3||&_discrete, &_continous, &_mdates, &_Ndiscrete, &_Ncontinous, &_CharDiscr, &_Characters.|
|Notes4-Legend||Section with definitions of local macro variables|
|Stat Tools Disclaimer||This set of SAS macros is developed by Arthur Watts and other members in the Department of Biostatistics and Computational Biology at the University of Rochester under the auspice of the CTSI BERD with the intent to facilitate to capture data information in all the related fields. It is copyrighted by Arthur Watts, 2009 and distributed for free public access.|
|Discliamer||The views expressed within CTSpedia are those of the author and must not be taken to represent policy or guidance on the behalf of any organization or institution with which the author is affiliated.|
|Permission|| Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT OLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.