Home
Biography
Books
Data Sets
Articles
Macros
Papers
Contact Us
e-mail me

SAS Macros

SAS Macros

To download a file, right-click on the icon and choose "Save Target As...." If you're using a Mac, click the icon while holding down the Ctrl key.  If you don't know how to use a SAS macro, click here to view a video produced by the the Methodology Center at Penn State.


COMBCHI

COMBCHI takes chi-square statistics from multiply imputed data sets and produces a single p-value.

Download combchi.sas

COMBINE

COMBINE takes estimates based on multiply imputed data sets and combines them into a single set of estimates and associated statistics. (Note: This macro has been largely superseded by PROC MIANALYZE).

Download combine.sas

GLOGIT

GLOGIT does maximum likelihood estimation of logistic regression models for two or more groups when the residual variance is allowed to differ across groups.

Download glogit.sas

LIFEHAZ

This macro plots the hazard function for a model fitted by PROC LIFEREG. This version works for Release 6.12 through Release 9.2 of SAS

Download LIFEHAZ.SAS

MISS

MISS uses the EM algorithm to estimate the parameters of a multivariate normal distribution when data are missing, and optionally generates multiply imputed data sets using the methods of J. L. Schafer, "Analysis of Incomplete Multivariate Data." (Note: This macro has been largely superseded by PROC MI which accomplishes the same tasks, but is much faster).

Download miss.sas

PREDICT

This macro calculates survival probabilities for models fitted by PROC LIFEREG. This version works for Release 8.2 of SAS and later.

Download PREDICT.SAS

SMOOTH

(Updated 11 March 2010). MACRO SMOOTH produces graphs of smoothed hazard functions using output from either LIFETEST or PHREG. With LIFETEST, it uses the data set produced by the OUTSURV option on the PROC statement. (Smoothing capabilities are built into release 9.2 of LIFEREG). With PHREG, it uses the data set produced by the BASELINE statement. SMOOTH employs a kernel smoothing method described by H. Ramlau-Hansen(1983), "Smoothing Counting Process Intensities by Means of Kernel Functions," The Annals of Statistics 11, 453-466. If there is more than one survival curve in the input data set, SMOOTH will produce multiple smoothed hazard curves on the same axes.

Download SMOOTH.SAS