List of Programs   ix

                       Preface   xiii

                       Acknowledgments   xv


Chapter 1   Environment and Guiding Principles   1

The Statistical Programmer’s Working Environment   2

Pharmaceutical Industry Vocabulary   2

Statistical Programmer Work Description   2

The Drug/Device Development Process   3

Industry Regulations and Standards   4

Your Clinical Trial Colleagues   8

Guiding Principles for the Statistical Programmer   10

Understand the Clinical Study   11

Program a Task Once and Reuse Your Code Everywhere   12

Clinical Trial Data Are Dirty   13

Use SAS Macros Judiciously   16

A Good Programmer Is a Good Student   18

Strive to Make Your Programming Readable   18


Chapter 2   Preparing and Classifying Clinical
                   Trial Data   19

Preparing Clinical Trial Data   20

“Clean” the Data If They Are Needed for Analysis   20

Categorize Data If Necessary   21

Avoid Hardcoding Data   24

Classifying Clinical Trial Data   26

Demographics and Trial-Specific Baseline Data   27

Concomitant or Prior Medication Data   27

Medical History Data   29

Investigational Therapy Drug Log   30

Laboratory Data   31

Adverse Event Data   32

Endpoint/Event Assessment Data   35

Clinical Endpoint Committee (CEC) Data   36

Study Termination Data   37

Treatment Randomization Data   38

Quality-of-Life Data   40


Chapter 3   Importing Data   41

Importing Relational Databases and Clinical Data Management Systems   42

SAS/ACCESS SQL Pass-Through Facility   42


Importing ASCII Text   44

PROC IMPORT and the Import Wizard   44

SAS DATA Step   52

SAS Enterprise Guide   53

Importing Microsoft Office Files   56

LIBNAME Statement   58

Import Wizard and PROC IMPORT   59

SAS/ACCESS SQL Pass-Through Facility   64

SAS Enterprise Guide   65

Importing XML   68

XML LIBNAME Engine   69

SAS XML Mapper   72


Importing Files in Other Proprietary Data Formats   79


Chapter 4   Transforming Data and Creating Analysis
                   Data Sets   83

Key Concepts for Creating Analysis Data Sets   84

Defining Variables Once   84

Defining Study Populations   85

Defining Baseline Observations   85

Last Observation Carried Forward (LOCF)   86

Defining Study Day   89

Windowing Data   91

Transposing Data   94

Categorical Data and Why Zero and Missing Results
   Differ Greatly   102

Performing Many-to-Many Comparisons/Joins   106

Using Medical Dictionaries   108

Other Tricks and Traps in Data Manipulation   112

Common Analysis Data Sets   118

Critical Variables Data Set   118

Change-from-Baseline Data Set   118

Time-to-Event Data Set   121


Chapter 5   Creating Tables and Listings   125

Creating Tables   126

General Approach to Creating Tables   126

A Typical Clinical Trial Table   127

Using PROC TABULATE to Create Clinical Trial Tables   128

Using PROC REPORT to Create Clinical Trial Tables   132

Creating Continuous/Categorical Summary Tables   137

Creating Adverse Event Summaries   146

Creating Concomitant or Prior Medication Tables   162

Creating a Laboratory Shift Table   169

Creating Kaplan-Meier Survival Estimate Tables   176

Creating Listings   184

Output Appearance Options and Issues   191

Creating ASCII Text Output   191

Creating Rich Text Format (RTF) Output   192

Creating Portable Document Format (PDF) Files   194

“Page X of N” Pagination Solutions   196

Footnote Indicating SAS Program and Date   197

SAS Macro-Based Reporting Systems   198


Chapter 6   Creating Clinical Trial Graphs   199

Common Clinical Trial Graphs   200

Scatter Plot   200

Line Plot   201

Bar Chart   202

Box Plot   203

Odds Ratio Plot   203

Kaplan-Meier Survival Estimates Plot   204

SAS Tools for Creating Clinical Trial Graphs   205

Common Clinical Trial SAS/GRAPH Procedures   205

Using the Annotate Facility for Graph Augmentation   206

Sample Graphs   207

Creating a Scatter Plot   207

Creating a Line Plot   210

Creating a Bar Chart   214

Creating a Box Plot   218

Creating an Odds Ratio Plot   228

Creating a Kaplan-Meier Survival Estimates Plot   233

Output Options   240

Selecting Graphics Drivers   240

Using ODS Destinations for SAS/GRAPH   241

Using SAS/GRAPH Assistants   244

Graph-N-Go   245

SAS Enterprise Guide   245

ODS Graphics   245

When You Should Use SAS/GRAPH   246


Chapter 7   Performing Common Analyses and Obtaining
                   Statistics   247

Obtaining Descriptive Statistics   248

Using PROC FREQ to Export Descriptive Statistics   248

Using PROC UNIVARIATE to Export Descriptive Statistics   249

Obtaining Inferential Statistics from Categorical Data
Analysis   251

Performing a 2x2 Test for Association   251

Performing an NxP Test for Association   252

Performing a Stratified NxP Test for Association   253

Performing Logistic Regression   254

Obtaining Inferential Statistics from Continuous Data
Analysis   255

Performing a One-Sample Test of the Mean   255

Performing a Two-Sample Test of the Means   257

Performing an N-Sample Test of the Means   258

Obtaining Time-to-Event Analysis Statistics   259

Obtaining Correlation Coefficients   260

General Approach to Obtaining Statistics   260


Chapter 8   Exporting Data   263

Exporting Data to the FDA   264

Using the SAS XPORT Transport Format   264

Creating XML Files   266

Exporting Data Not Destined for the FDA   276

Exporting Data with PROC CPORT   276

Exporting ASCII Text   276

Exporting Data to Microsoft Office Files   283

Exporting Other Proprietary Data Formats   287

Encryption and File Transport Options   288


Chapter 9   The Future of SAS Programming in  
                  Clinical Trials   289

Changes in the Business Environment   290

Changes in Technology   290

Changes in Regulations   291

Changes in Standards   291

Use of SAS Software in the Clinical Trial Industry   292


Chapter 10 Further Resources   293

Regulatory Resources   294

SAS Programming Validation   294

FDA Resources   295

Standards and Industry Organizations   296

SAS Help   296

SAS-L   296

SAS Technical Support   297

SAS Users Groups   297

SAS Manuals and Online Documentation   297

SAS Press   298

Community Pages at SAS   298

Third-Party SAS Web Pages   298

Useful Technical Skills   299

Scripting   299

Version Control Software   299

VBScript/JavaScript for Applications   299

Systems Development Life Cycle   299

Modeling Tools   300

Markup Languages   300

File Transport and Data Encryption Technologies   300

Other Applications Development Languages   300

Qualifying for and Obtaining a Job   301


                       Glossary   303

                       Index   321