Posts Tagged ‘ Tips and Techniques ’

Techniques for scoring a regression model in SAS

February 19, 2014
By
Techniques for scoring a regression model in SAS

My previous post described how to use the "missing response trick" to score a regression model. As I said in that article, there are other ways to score a regression model. This article describes using the SCORE procedure, a SCORE statement, the relatively new PLM procedure, and the CODE statement.
Read more »

Tags: , , , ,
Posted in SAS | Comments Off

The missing value trick for scoring a regression model

February 17, 2014
By
The missing value trick for scoring a regression model

A fundamental operation in statistical data analysis is to fit a statistical regression model on one set of data and then evaluate the model on another set of data. The act of evaluating the model on the second set of data is called scoring. One of first "tricks" that I
Read more »

Tags: , , ,
Posted in SAS | Comments Off

Write a matrix in the "long form"

December 2, 2013
By
Write a matrix in the "long form"

If you write an n x p matrix from PROC IML to a SAS data set, you'll get a data set with n rows and p columns. For some applications, it is more convenient to write the matrix in a "long format" with np observations and three columns. The first
Read more »

Tags: , ,
Posted in SAS | Comments Off

Square root transformations: How to handle negative data values?

October 30, 2013
By
Square root transformations: How to handle negative data values?

I was looking at someone else's SAS/IML program when I saw this line of code: y = sqrt(x<>0); The statement uses the element maximum operator (<>) in the SAS/IML language to make sure that negative value are never passed to the square root function. This little trick is a real
Read more »

Tags: , ,
Posted in SAS | Comments Off

Six reasons you should stop using the RANUNI function to generate random numbers

July 10, 2013
By
Six reasons you should stop using the RANUNI function to generate random numbers

Are you still using the old RANUNI, RANNOR, RANBIN, and other "RANXXX" functions to generate random numbers in SAS? If so, here are six reasons why you should switch from these older (1970s) algorithms to the newer (late 1990s) Mersenne-Twister algorithm, which is implemented in the RAND function. The newer
Read more »

Tags: , ,
Posted in SAS | Comments Off

Passing values from PROC IML into SAS procedures

June 3, 2013
By

A SAS user told me that he computed a vector of values in the SAS/IML language and wanted to use those values on a statement in a SAS procedure. The particular application involved wanting to use the values on the ESTIMATE and CONTRAST statements in a SAS regression procedure, but
Read more »

Tags: , ,
Posted in SAS | Comments Off

Turn off ODS when running simulations in SAS

May 24, 2013
By

In my article "Simulation in SAS: The slow way or the BY way," I showed how to use BY-group processing rather than a macro loop in order to efficiently analyze simulated data with SAS. In the example, I analyzed the simulated data by using PROC MEANS, and I use the
Read more »

Tags: , ,
Posted in SAS | Comments Off

How to overlay custom curves with PROC SGPLOT

April 22, 2013
By
How to overlay custom curves with PROC SGPLOT

I recently showed someone a trick to create a graph, and he was extremely pleased to learn it. The trick is well known to many SAS users, but I hope that this article will introduce it to even more SAS users. At issue is how to use the SGPLOT procedure
Read more »

Tags: , ,
Posted in SAS | Comments Off

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.