Calculating Covariance by SAS, A Brutal Way

May 12, 2015
By
Calculating Covariance by SAS, A Brutal Way

It was very disappointed that there is only one built-in method to calculate covariance in Base SAS: that’s in PROC CORR (while you can also do it in SAS/IML, of course): The following is a quick-and-dirty way to get a function like %COV: %macro COV(data, var1,var2); %local _cov; %let rc = %sysfunc(dosubl(%str(     ods...
Read more »

Import .Rdata to SAS, along with Labels

May 12, 2015
By
Import .Rdata to SAS, along with Labels

I didn’t play with SAS/IML for a while. I call it back when I need to read some R format data. Technically, .Rdata is not a data format. It’s rather a big container to hold bunch of R objects: In this example, when a .Rdata is loaded, 3 objects are included where ‘data’(the ‘real’...
Read more »

Creating your own customized graphs for SAS analytic procedures

May 12, 2015
By

In recent releases of SAS, you can use Output Delivery System graphics or 'ODS graphics on' to produce nice graphical output for most of the analytic procedures. These default graphs are nice, but when you want your graphs to look "a certain way" SAS also lets you create your own custom graphs!

The post Read more »

Stata’s Academic Growth Nearly as Fast as R’s

May 11, 2015
By
Stata’s Academic Growth Nearly as Fast as R’s

by Bob Muenchen Analytics tools take significant effort to master, so once learned people tend to stick with them for much of their careers. This makes the tools used in academia of particular interest in the study of future trends … Continue reading
Read more »

Using FILENAME ZIP to unzip and read data files in SAS

May 11, 2015
By

I've written about how to use the FILENAME ZIP method to read and update ZIP files in your SAS programs. The ZIP method was added in SAS 9.4, and its advantage is that you can accomplish more in SAS without having to launch external utilities such as WinZip, gunzip, or

The post Read more »

Finding observations that satisfy multiple conditions

May 11, 2015
By

A common task in data analysis is to locate observations that satisfy multiple criteria. For example, you might want to locate all zip codes in certain counties within specified states. The SAS DATA step contains the powerful WHERE statement, which enables you to extract a subset of data that satisfy

The post Read more »

Fast SQL moving average calculation without windowing functions

May 11, 2015
By
Fast SQL moving average calculation without windowing functions

In this post, I show a trick to do moving average calculation (can be extended to other operations requiring windowing functions) that is super fast.

Often, SAS analysts need to conduct moving average calculation and there are several options by the order of preference:

1. PROC EXPAND
2. DATA STEP
3. PROC SQL

But many...
Read more »

SAS Certification on a Budget

May 8, 2015
By
SAS Certification on a Budget

I recently returned from SAS Global Forum where Andra Northup and I presented an updated and expanded version of our paper “SAS Certification as a Tool for Professional Development.”  You can read our paper here. SAS certification isn’t exactly new.  The first SAS certification exam was offered way back in 1999.  So it’s fascinating...
Read more »

U.S. federal government is shrinking

May 7, 2015
By

I was surprised to find that the size of the U.S. federal government is smaller today, than in the past many decades - let's graph it out, so it's easy to analyze... The way I got started on this little adventure was via Jishai's graph on dadaviz.com. Here's a snapshot

The post Read more »

Proc-x is looking for sponsors!

Dear readers, proc-x is looking for sponsors who would be willing to support the site in exchange for banner ads in the right sidebar of the site. If you are interested, please e-mail me at: [email protected]

Welcome!

SAS-X.com offers news and tutorials about the various SAS® software packages, contributed by bloggers. You are welcome to subscribe to e-mail updates, or add your SAS-blog to the site.

SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration.