Tag: macro

A macro calls random forest in SAS

SASHELP.CARS, with 428 observations and 15 variables, is a free dataset in SAS for me to exercise any classification methods. I always have the fantasy to predict which country a random car is manufactured by, such as US, Japan or Europe. After tryi…

NOTE: Inadequate Mends

%macro article;
In the last couple of weeks I’ve been confronted with a lot of macro code. I love SAS Macro language (is there a cure for this?) but it drives me nuts when the name of the macro is not appended to the respective %MEND statement.

Macros communicate SQLite and SAS without ODBC

SQLite is an open-sourced relationship database management system with full functionality [Ref.1]. The light-weight (300k+ size) and zero configuration features distinguish it from its’ 800-pound counterparts like Oracle or MySQL. Thanks to the rise…

Support vector machine for classification in SAS by R

I just recently discovered endless fun to synchronize SAS and R to do something meaningful. Yep, I am a SAS programmer: during the day time, I use SAS for money; at the evening, I use R for fun. It is always exciting to hook up them together. How abo…

A macro calls R in SAS for paneled 3d plotting

SAS and R could complement each other. SAS is a versatile ETL (extraction, transformation and loading) machine and its statistical procedures based on generalized linear model are impeccable. R would bring cutting-edge data mining and data visualizatio…

Labeling variables by a macro in SAS

To rename the variables of a dataset in SAS is a daily routine. SAS or the programmer s would give an arbitrary name for any variable at the initial stage of data integration. Those names have to be modified afterward. Weisui [Ref.1] developed a macro …

Using SAS to find the best k for k-Nearest Neighbor classification

Least-square (regression) and nearest-neighbor are the most fundamental methodologies for supervised classification [Ref. 1]. Even though they are pretty old, they are still popular and widely used in academia and industry. There is a trade-off in comp…

Quasi-Monte Carlo simulation by functional programming in SAS

The concept of functional programming could be next big thing for those data-driven computer languages. Compared with encapsulation, inheritance, overloading, design pattern, and many other must-learn contents based on class and super-class, functions …