Category: SAS

The "do over" syntax for arrays

This is another useful not-a-trick.
No longer to be found in the documentation is the “do over” syntax, which can simplify code and keep datasets narrower.  The syntax works like this:

data …;array arrayname x y z var1 – var3; do over arra…

Discrimanant Analysis, Priors, and Fairy-Selection

A student in my multivariate class last month asked a question about prior probability specifications in discriminant function analysis:
What if I don’t know what the probabilities are in my population? Is it best to just use the default in PROC D…

LAG function

LAG Function (SAS 9.2 Doc)*** Use a third variable to assign the value from the previous record;array one a b c d;array two e f g h;&nbsp &nbsp &nbsp do over one;&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp temp = lag(one);&nbsp &nbsp &nbsp &nbsp &nbsp &nbsp if…

SAS Data Step Illustrated: Guest Blog by Jiangtang Hu

The following blog is reprinted by permission of the author Jiangtang Hu. Hu is a SAS programmer living in Beijing who writes blogs in both English and Chinese. (Full disclosure: Hu quoted The Little SAS Book, but I had never met him before he wrote this blog.) SAS Data Step’s Built-in Loop: An Illustrated Example […]

PROC LOGISTIC odds ratio estimate

I ran into some problems with the interpretation of the parameter estimate of the logistic model recently. When I contacted SAS, here’s their response. Please make sure you specify PARAM=GLM option in the CLASS statement when you want the parameterizat…

PROC GPLOT options: AUTOHREF and AUTOVREF

Use the AUTOHREF and AUTOVREF options on the PLOT statement of PROC GPLOT to draw reference lines at all major tickmarks. Create an annotate data to draw thicker reference lines at the desired tickmarks.goptions reset=all;/* Create sample data */data …

PROC LOGISTIC options: selection=, hierarchy=

An additional option that you should be aware of when using SELECTION= with a model that has the interaction as a possible variable is the HIERARCHY= option. It specifies whether and how the model hierarchy requirement is applied and whether a single e…