7   Restructuring SAS Data Sets Using Arrays

Introduction

Creating a New Data Set with Several Observations per Subject from a Data Set with One Observation per Subject

Another Example of Creating Multiple Observations from a Single Observation

Going from One Observation per Subject to Many Observations per Subject Using Multidimensional Arrays

Demonstrating the Use of a Multidimensional Array

An Alternative Program

Another Example of a Multidimensional Array

Introduction

One approach to working with longitudinal data sets is to restructure the data set—either going from one observation per subject (or other unit of analysis) to several or vice versa. For example, you may have several diagnosis codes in a single observation (visit) and want to ...

Get Longitudinal Data and SAS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.