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;      do over one;            temp = lag(one);            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 […]
Calculate new variables using the sum of other columns in PROC REPORT
%macro vol(type,desc);proc report data=fmxx center headline headskip split=’/’;      column site_id havevis &type.2 &type.3 &type.p1 &type.p2;      define site_id / group id order=internal width=16 left ‘Clinical Center’style(h…
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…