Book description
Working with longitudinal data introduces a unique set of challenges. Once you've mastered the art of performing calculations within a single observation of a data set, you're faced with the task of performing calculations or making comparisons between observations. It's easy to look backward in data sets, but how do you look forward and across observations? Ron Cody provides straightforward answers to these and other questions. Longitudinal Data and SAS details useful techniques for conducting operations between observations in a SAS data set. For quick reference, the book is conveniently organized to cover tools, including an introduction to powerful SAS programming techniques for longitudinal data; case studies, including a variety of illuminating examples that use Ron's techniques; and macros, including detailed descriptions of helpful longitudinal data macros. Beginning to intermediate SAS users will appreciate this book's informative, easy-to-comprehend style. And users who frequently process longitudinal data will learn to make the most of their analyses by following Ron's methodologies. This book is part of the SAS Press program.Table of contents
- List of Programs
- Preface
-
Acknowledgments
- 1 The RETAIN Statement
- Introduction
- Demonstrating a DATA Step with and without a RETAIN Statement
- Generating Sequential SUBJECT Numbers Using a Retained Variable
- Using a SUM Statement to Create SUBJECT Numbers
- Demonstrating That Variables Read with a SET Statement Are Retained
- A Caution When Using a RETAIN Statement
- 2 The LAG and DIF Functions
- 3 FIRST. and LAST. Temporary Variables
- 4 Flags and Counters
-
5 Summarizing Data Using PROC MEANS and PROC FREQ
- Introduction
- Using PROC MEANS to Output Means to a Data Set
- Comparing CLASS and BY Statements with PROC MEANS
- Computing Other Descriptive Statistics
- Automatically Naming the Variables in the Output Data Set
- Demonstrating an Alternative Way to Select Specific Descriptive Statistics for Selected Variables
- Adding Additional Variables to the Summary Data Set Using an ID Statement
- Specifying More Than One CLASS Variable
- Selecting Multi-Way Breakdowns Using the TYPES Statement
- Using the PROC MEANS CHARTYPE Option to Simplify the _TYPE_ Interpretation
- Comparing PROC MEANS and PROC FREQ for Creating an Output Data Set Containing Counts
- Counting Frequencies for a Two-Way Table
- 6 Using PROC SQL with Longitudinal Data
-
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
-
8 Restructuring SAS Data Sets Using PROC TRANSPOSE
- Introduction
- Going from One Observation to Several Observations
- Another Example of Creating Multiple Observations from a Single Observation
- Going from One Observation per Subject to Many Observations per Subject
- Creating a Data Set with One Observation per Subject from a Data Set with Multiple Observations per Subject
-
9 Study One: Operations on a Clinical Database
- Introduction
- Description of the Clinical Data Set
- Selecting the First or Last Visit for Each Patient
- Computing Differences between the First and Last Visits
- Another Method of Computing Differences between the First and Last Visits
- Computing Differences between Every Visit
- Counting the Number of Visits for Each Patient (DATA Step Approach
- Counting the Number of Visits for Each Patient (PROC FREQ)
- Counting the Number of Visits for Each Patient (PROC MEANS)
- Counting the Number of Visits for Each Patient (PROC SQL)
- Selecting All Patients with nVisits (DATA Step Approach)
- Selecting All Patients with nVisits (PROC FREQ Approach)
- Selecting All Patients with Two Visits (Using PROC SQL)
- Selecting All Patients with Two Visits (Using SQL in One Step)
- Using PROC SQL to Create a Macro Variable
- Computing Summary Statistics for Each Patient (Using PROC MEANS
- Computing Summary Statistics for Each Patient (Using PROC SQL
- Adding a Value from the First Visit to Each Subsequent Visit
- Looking Ahead: Making a Decision about the Current Observation Based on Information in the Next Observation
- Using Flags to Ascertain Vitamin Use
- Using PROC FREQ to Ascertain Vitamin Use
- Counting the Number of Routine Visits for Each Patient
- 10 Study Two: Operations on Daily Weather Data and Ozone Levels
- 11 Study Three: Producing Summary Reports on a Library Data Set
- 12 Useful Macros
- Appendix List of List of Data Files and SAS Data Sets
- Index
Product information
- Title: Longitudinal Data and SAS
- Author(s):
- Release date: October 2001
- Publisher(s): SAS Institute
- ISBN: 9781629592497
You might also like
book
Handbook of SAS DATA Step Programming
This handbook shows readers how best to manage and manipulate data by using the DATA step …
book
Analysis of Observational Health Care Data Using SAS
This book guides researchers in performing and presenting high-quality analyses of all kinds of non-randomized studies, …
book
Fixed Effects Regression Methods for Longitudinal Data Using SAS
Fixed Effects Regression Methods for Longitudinal Data Using SAS, written by Paul Allison, is an invaluable …
book
Nonparametric Methods in Statistics with SAS Applications
Designed for a graduate course in applied statistics, Nonparametric Methods in Statistics with SAS Applications teaches …