Longitudinal Data And Sas / Edition 1

Longitudinal Data And Sas / Edition 1

by Ron Cody
     
 

ISBN-10: 1580259243

ISBN-13: 9781580259248

Pub. Date: 10/15/2001

Publisher: SAS Institute Inc.

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…  See more details below

Overview

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-an introduction to powerful SAS programming techniques for longitudinal data; case studies-a variety of illuminating examples that use Ron's techniques; and macros-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.

Read More

Product Details

ISBN-13:
9781580259248
Publisher:
SAS Institute Inc.
Publication date:
10/15/2001
Edition description:
New Edition
Pages:
208
Sales rank:
1,153,373
Product dimensions:
7.50(w) x 9.25(h) x 0.44(d)

Related Subjects

Table of Contents

List of Programsix
Prefacexvii
Acknowledgmentsxix
1The RETAIN Statement
Introduction1
Demonstrating a DATA Step with and without a RETAIN Statement1
Generating Sequential SUBJECT Numbers Using a Retained Variable7
Using a SUM Statement to Create SUBJECT Numbers9
Demonstrating That Variables Read with a SET Statement Are Retained10
A Caution When Using a RETAIN Statement11
2The LAG and DIF Functions
Introduction13
Using the LAG Function to Compute Differences13
Demonstrating Some Related Functions: LAG2, LAG3, and So Forth16
Demonstrating the DIF Function17
3FIRST. and LAST. Temporary Variables
Introduction19
How to Create FIRST. and LAST. Temporary Variables19
Using More Than One BY Variable22
A Simple Application Using FIRST. and LAST. Variables24
4Flags and Counters
Introduction27
Using a Flag Variable to Determine If a Particular Event Ever Occurred in Any One of Several Observations for Each Subject27
Counting the Number of Positive Outcomes for Each Patient29
5Summarizing Data Using PROC MEANS and PROC FREQ
Introduction33
Using PROC MEANS to Output Means to a Data Set34
Comparing CLASS and BY Statements with PROC MEANS37
Computing Other Descriptive Statistics38
Automatically Naming the Variables in the Output Data Set40
Demonstrating an Alternative Way to Select Specific Descriptive Statistics for Selected Variables41
Adding Additional Variables to the Summary Data Set Using an ID Statement42
Specifying More Than One CLASS Variable44
Selecting Multi-Way Breakdowns Using the TYPES Statement47
Using the PROC MEANS CHARTYPE Option to Simplify the _TYPE_ Interpretation49
Comparing PROC MEANS and PROC FREQ for Creating an Output Data Set Containing Counts50
Counting Frequencies for a Two-Way Table52
6Using PROC SQL with Longitudinal Data
Introduction55
Creating a Demonstration Data Set55
A Simple SQL Query57
Using PROC SQL to Count Observations within a BY Group58
Demonstrating a HAVING Clause59
Using PROC SQL to Create a Macro Variable60
Using a Summary Function to Compute Group Means62
7Restructuring SAS Data Sets Using Arrays
Introduction65
Creating a New Data Set with Several Observations per Subject from a Data Set with One Observation per Subject66
Another Example of Creating Multiple Observations from a Single Observation69
Going from One Observation per Subject to Many Observations per Subject Using Multidimensional Arrays72
Demonstrating the Use of a Multidimensional Array74
An Alternative Program77
Another Example of a Multidimensional Array78
8Restructuring SAS Data Sets Using PROC TRANSPOSE
Introduction81
Going from One Observation to Several Observations81
Another Example of Creating Multiple Observations from a Single Observation84
Going from One Observation per Subject to Many Observations per Subject86
Creating a Data Set with One Observation per Subject from a Data Set with Multiple Observations per Subject88
9Study One: Operations on a Clinical Database
Introduction94
Description of the Clinical Data Set94
Selecting the First or Last Visit for Each Patient95
Computing Differences between the First and Last Visits97
Another Method of Computing Differences between the First and Last Visits99
Computing Differences between Every Visit100
Counting the Number of Visits for Each Patient (DATA Step Approach)101
Counting the Number of Visits for Each Patient (PROC FREQ)103
Counting the Number of Visits for Each Patient (PROC MEANS)103
Counting the Number of Visits for Each Patient (PROC SQL)104
Selecting All Patients with n Visits (DATA Step Approach)105
Selecting All Patients with n Visits (PROC FREQ Approach)106
Selecting All Patients with Two Visits (Using PROC SQL)107
Selecting All Patients with Two Visits (Using SQL in One Step)107
Using PROC SQL to Create a Macro Variable108
Computing Summary Statistics for Each Patient (Using PROC MEANS)109
Computing Summary Statistics for Each Patient (Using PROC SQL)110
Adding a Value from the First Visit to Each Subsequent Visit111
Looking Ahead: Making a Decision about the Current Observation Based on Information in the Next Observation114
Using Flags to Ascertain Vitamin Use117
Using PROC FREQ to Ascertain Vitamin Use118
Counting the Number of Routine Visits for Each Patient119
10Study Two: Operations on Daily Weather Data and Ozone Levels
Introduction121
The OZONE Data Set121
Computing Weekly Averages122
Using the MOD Function to Group Data Values125
Computing a Moving Average for a Single Variable127
11Study Three: Producing Summary Reports on a Library Data Set
Introduction129
Computing the Number of Books per Patron Visit and by Library130
Computing the Number of Patrons by Day of Week and Library134
Generating a Table of LC Categories by Age Group and Overall135
12Useful Macros
Introduction141
Listing All or Part of a Data Set141
Computing Differences between Successive Observations143
Computing Differences between the First and Last Observations per Subject145
Computing a Moving Average147
Computing Cell Means and Counts149
Counting the Number of Observations per Subject151
AppendixList of Data Files and SAS Data Sets
The TEST_SCORES Data Set153
The CLINICAL Data Set154
The CLIN_FIRST Data Set156
The OZONE Data Set157
The LIBRARY Data Set160
Index165

Read More

Customer Reviews

Average Review:

Write a Review

and post it to your social network

     

Most Helpful Customer Reviews

See all customer reviews >