Personal Web Page for David A. Boulifard

Home | Background | Research | Software | Contact





This page presents some of the software I have developed.

Quick Access Table

Excel Tools Overview

SAS Tools Overview




Quick Access Table

You can retrieve items collectively or individually.  All of them work independently, except for the SAS macro comma, which calls delimit.  If you download and extract the zipped SAS folder, you can run as a demo after editing two lines to specify folder paths.


Excel Tools

Version Date:  12/18/2010



change log

Database Management


data dictionary template

Findings Presentation


statistical table composition


regression interaction plot

SAS Tools

Version Date:  04/27/2017



change log

Programming Environment

project startup program

Utility Macros

String Manipulation

string substitution

List Manipulation

number sequence generation

item count

item display

delimiter replacement (general)

delimiter replacement (to comma)

item concatenation

set difference

set difference (symmetric)

set intersection

set union

duplicate removal

List Processing

pre-structured execution loop (one- or two-way)

Statistical Computation

descriptive statistic (with limit on missing)

product term generation

Statistical Analysis

data availability/missingness patterns

regression table (linear)





Excel Tools Overview

These items are workbooks to assist with database management and findings presentation.

Database Management

Data_Dict.xls is a data dictionary template.  A data dictionary describes the structure and content of a database.  The heart of this dictionary is a worksheet table that presents database variables in rows and lists information about them in columns.  Other sheets in the workbook help you to build and maintain this table.  If you can use Excel to search, sort, and filter information, this workbook can facilitate your management of large and complex databases, increase your speed and accuracy in programming, and enhance your perceptions of data.


Findings Presentation

Tables.xls assists you in preparing tabular displays of statistical data.  It allows you to arrange, identify, and format statistics within a table, apart from the place where you store them.  This capability helps to bridge the gap between the output formats of analysis programs and the stylistic requirements of scientific reporting.  Once you compose a table and provide the statistics, you can print the resulting display directly from the worksheet or copy and paste it into other locations, such as word processing documents.




Plot_Reg_X.xls assists you in illustrating statistical interaction effects obtained in multiple regression analyses.  You obtain the effects by introducing predictor variables that are products of a Focal term and one or two Moderator terms.  Once you fit the model, you enter information into the worksheet table and a plot of simple effects appears in the chart.






SAS Tools Overview

These items are programs for establishing a programming environment and installing utility macros.

Programming Environment is a startup program template.  The program you create from it establishes the SAS environment for a project, specifying directories and libraries in a way that facilitates portability.  It also runs programs that install the macros described below.

Utility Macros

These programs install utility macros.  Many of these macros behave like macro functions, producing text you can process within macro expressions.  Others are stand-alone programs.

Each program installs one macro, using its name root as the macro's name; for example, installs replace.  The program begins with a comment section that describes the macro and illustrates its use.  The startup program template discussed above also provides a quick reference guide in the section that runs the installation programs.  What follows is a more conceptual guide.



String Manipulation

These macros treat a text string as a sequence of characters without any structure.  Currently there is only one, replace, which searches a text string to replace each occurrence of one character sequence with another character sequence.

List Manipulation

These macros treat a text string as a list of items separated by delimiter characters.  Ordinarily, items are names, name-prefixes, name-suffixes, or numbers, whereas delimiters are blanks; but other schemes are possible:

%let MyVars = V01 V02 V03 V04;   * names delimited by blanks;
%let MyTabs = a*b | a*c | b*c; * crosstab requests delimited by vertical bars;

Some of these macros create, describe, or maintain lists.  For example, integers generates a list of integers; count counts the items in a list; enumerate displays the items in a list; and delimit changes the delimiter character in a list.  Others perform operations involving comparison or combination.  For example, set_dif selects the items present in one list but absent from another; and catenate joins the items in one list with those in another.

These macros can facilitate many activities involving name lists.  For example, you could generate a list of names V01 V02 ... V12, as follows:

%let MyVars = %catenate(V, %integers(12));

You could also specify a list of "drop" variables from lists of "all" and "keep" variables, as follows:

%let DropVars = %set_dif(&AllVars., &KeepVars.);

List Processing

This macro, named loop, performs a task once for each item in a delimited list, or each pairing of items from two such lists.  You specify the task in a line of SAS code, which serves as a template.  Your code refers generically to an item via the macro variable x, or to a pair of items via the macro variables x and y.  When you call loop, it runs each item or pair of items in turn through the template.  The SAS system will treat any text this processing generates as if you had coded it in place of the call to loop.

The freedom with which you can specify tasks and item lists in a variety of contexts gives loop a wide range of applications.  For example, you could generate the names V01 V02 ... V12 as above, without using catenate, as follows:

%let MyVars = %loop(%nrstr( V&x.), %integers(12));

You could also create log-transformed versions LogA, LogB, and LogC of data set variables A, B, and C within a Data step as follows:

%macro xfm;
Log&x. = log(&x.);

data mydb2;
set  mydb1;
%loop(%nrstr(%xfm), A B C)

Statistical Computation

These macros assist in preparing databases for statistical analysis by performing computations.  Both are called in the SAS Data Step.  One of them, desc_stat, applies a SAS descriptive statistics function (e.g., mean) to a list of data set variables, with a limit on the number of argument values allowed to be missing.  The other, prod_term, generates product terms from selected pairs of data set variables for use in fitting statistical interaction effects.

Statistical Analysis

These macros assist in performing statistical analyses and reporting findings.  Both are called independently.  One of them, missing, examines selected data set variables to create corresponding indicator variables that denote data availability/missingness.  These indicator variables can facilitate the analysis of patterns or the application of remedies.  The other macro, tbl_reg_lin, performs a linear regression of an outcome variable on a set of predictor variables, and stores components of the statistical output, along with other statistical information, in tabular form as a SAS data set.  You can retrieve this data set as a spreadsheet to facilitate the preparation of statistical tables and graphs (see section above on findings presentation tools):