A Handbook of Statistical Analyses using SAS

Similar documents
Applied Medical. Statistics Using SAS. Geoff Der. Brian S. Everitt. CRC Press. Taylor Si Francis Croup. Taylor & Francis Croup, an informa business

Practical Multivariate Analysis

PRACTICAL STATISTICS FOR MEDICAL RESEARCH

isc ove ring i Statistics sing SPSS

The Statistical Analysis of Failure Time Data

From Biostatistics Using JMP: A Practical Guide. Full book available for purchase here. Chapter 1: Introduction... 1

Data Analysis with SPSS

LAB ASSIGNMENT 4 INFERENCES FOR NUMERICAL DATA. Comparison of Cancer Survival*

Data Analysis Using Regression and Multilevel/Hierarchical Models

SAMPLING ERROI~ IN THE INTEGRATED sysrem FOR SURVEY ANALYSIS (ISSA)

Ecological Statistics

List of Figures. List of Tables. Preface to the Second Edition. Preface to the First Edition

Contents. Part 1 Introduction. Part 2 Cross-Sectional Selection Bias Adjustment

ADVANCED VBA FOR PROJECT FINANCE Near Future Ltd. Registration no

STATISTICS IN CLINICAL AND TRANSLATIONAL RESEARCH

A Guide to Algorithm Design: Paradigms, Methods, and Complexity Analysis

Understandable Statistics

Comparison And Application Of Methods To Address Confounding By Indication In Non- Randomized Clinical Studies

Perception of risk of depression: The influence of optimistic bias in a non-clinical population of women

BIOSTATISTICAL METHODS AND RESEARCH DESIGNS. Xihong Lin Department of Biostatistics, University of Michigan, Ann Arbor, MI, USA

CLINICAL BIOSTATISTICS

An Introduction to Modern Econometrics Using Stata

Biology 345: Biometry Fall 2005 SONOMA STATE UNIVERSITY Lab Exercise 5 Residuals and multiple regression Introduction

Applications. DSC 410/510 Multivariate Statistical Methods. Discriminating Two Groups. What is Discriminant Analysis

A SAS Macro for Adaptive Regression Modeling

HANDOUTS FOR BST 660 ARE AVAILABLE in ACROBAT PDF FORMAT AT:

Bangor University Laboratory Exercise 1, June 2008

Statistics on Drug Misuse: England, 2008

Biostatistics II

MEASURES OF ASSOCIATION AND REGRESSION

DMRI Drug Misuse Research Initiative

CRITERIA FOR USE. A GRAPHICAL EXPLANATION OF BI-VARIATE (2 VARIABLE) REGRESSION ANALYSISSys

PROC CORRESP: Different Perspectives for Nominal Analysis. Richard W. Cole. Systems Analyst Computation Center. The University of Texas at Austin

HIV Development Assistance and Adult Mortality in Africa: A replication study of Bendavid et al. (2012)

Today: Binomial response variable with an explanatory variable on an ordinal (rank) scale.

STATISTICS INFORMED DECISIONS USING DATA

Daniel Boduszek University of Huddersfield

Measurement Error in Nonlinear Models

Introduction to SPSS S0

Introduction. Lecture 1. What is Statistics?

BIOL 458 BIOMETRY Lab 7 Multi-Factor ANOVA

Centering Predictors

MAKING THE NSQIP PARTICIPANT USE DATA FILE (PUF) WORK FOR YOU

Statistical Methods and Reasoning for the Clinical Sciences

CONVENTIONAL AND UNCONVENTIONAL GRAPHS IN SAS. Singer Júlia Chinoin Pharmaceutical and Chemical Works Ltd, Hungary

Applied Linear Regression

A Vision-based Affective Computing System. Jieyu Zhao Ningbo University, China

What Are Your Odds? : An Interactive Web Application to Visualize Health Outcomes

Bayesian Logistic Regression Modelling via Markov Chain Monte Carlo Algorithm

City, University of London Institutional Repository

STATISTICAL METHODS FOR DIAGNOSTIC TESTING: AN ILLUSTRATION USING A NEW METHOD FOR CANCER DETECTION XIN SUN. PhD, Kansas State University, 2012

The Association Design and a Continuous Phenotype

Women s use of complementary and alternative medicine for the treatment of menopause-related symptoms: A health services research study.

Manual of Smoking Cessation

CLASSICAL AND. MODERN REGRESSION WITH APPLICATIONS

CHAPTER 3 DATA ANALYSIS: DESCRIBING DATA

Discovering Meaningful Cut-points to Predict High HbA1c Variation

SUBSTANCE ABUSE AND DEPENDENCE

Development of the Web-Based Child Asthma Risk Assessment Tool

The North Carolina Health Data Explorer

Models of good practice in drug treatment in Europe. Project group

Neuroinformatics. Ilmari Kurki, Urs Köster, Jukka Perkiö, (Shohei Shimizu) Interdisciplinary and interdepartmental

Substance use and misuse

DATA ANALYSIS & STATISTICAL PACKAGES. Daniel Inusa Yakmut ICT Directorate Federal University Lafia

An Introduction to Statistical Thinking Dan Schafer Table of Contents

APPENDIX D REFERENCE AND PREDICTIVE VALUES FOR PEAK EXPIRATORY FLOW RATE (PEFR)

Programme Name: Climate Schools: Alcohol and drug education courses

appstats26.notebook April 17, 2015

Edinburgh Research Explorer

6.1.2 Other multi-agency groups which feed into the ADP and support the on-going work includes:

DECISION ANALYSIS WITH BAYESIAN NETWORKS

f WILEY ANOVA and ANCOVA A GLM Approach Second Edition ANDREW RUTHERFORD Staffordshire, United Kingdom Keele University School of Psychology

4Stat Wk 10: Regression

Appendix: Supplementary tables [posted as supplied by author]

Psychology of Perception Psychology 4165, Spring 2003 Laboratory 1 Weight Discrimination

Treatment effect estimates adjusted for small-study effects via a limit meta-analysis

Psychology of Perception Psychology 4165, Fall 2001 Laboratory 1 Weight Discrimination

Understanding. Regression Analysis

IBRIDGE 1.0 USER MANUAL

University of Dundee. Statistical packages and clinical psychology research Peck, Dave; Dow, Mike; Goodall, William

Chapter 3: Examining Relationships

TEACHING REGRESSION WITH SIMULATION. John H. Walker. Statistics Department California Polytechnic State University San Luis Obispo, CA 93407, U.S.A.

How to interpret scientific & statistical graphs

Midterm Exam ANSWERS Categorical Data Analysis, CHL5407H

Certificate Courses in Biostatistics

Academic achievement and its relation to family background and locus of control

FINAL REPORT CT.98.EP.04

Chapter 9. Factorial ANOVA with Two Between-Group Factors 10/22/ Factorial ANOVA with Two Between-Group Factors

CHAPTER 3 RESEARCH METHODOLOGY

Chapter 1: Exploring Data

Measuring the User Experience

UMbRELLA interim report Preparatory work

Daniel Boduszek University of Huddersfield

Contents 1 Measurement in Human Service Enterprises: History and Challenges 2 Measurement as Communication

Multiple Linear Regression Analysis

Chapter 3: Describing Relationships

Predicting About-to-Eat Moments for Just-in-Time Eating Intervention

Referral to the Women s Alcohol and Drug Service (WADS) Procedure

Inflammation in Adolescence and Schizophrenia Risk in Adulthood By Brian Miller, MD, PhD, MPH

Contents. copyrighted material by PRO-ED, Inc.

Transcription:

A Handbook of Statistical Analyses using SAS SECOND EDITION Geoff Der Statistician MRC Social and Public Health Sciences Unit University of Glasgow Glasgow, Scotland and Brian S. Everitt Professor of Statistics in Behavioural Science Institute of Psychiatry University of London London, U.K. SUB Gottingen 7 213 590 794 2001 A 13946 CHAPMAN & HALL/CRC Boca Raton London New York Washington, D.C.

Contents 1 A Brief Introduction to SAS 1 1.1 Introduction 1 1.2 The Microsoft Windows User Interface 2 1.2.1 The Editor Window 3 1.2.2 The Log and Output Windows 4 1.2.3 Other Menus 4 1.3 The SAS Language 5 1.3.1 All SAS Statements Must End with a Semicolon 6 1.3.2 Program Steps 6 1.3-3 Variable Names and Data Set Names 7 1.3.4 Variable Lists 7 1.4 The Data Step 11 1.4.1 Creating SAS Data Sets from Raw Data 11 1.4.2 The Data Statement 12 1.4.3 The Infile Statement 12 " 1.4.4 The Input Statement 13 1.4.5 Reading Data from an Existing SAS Data Set 17 1.4.6 Storing SAS Data Sets on Disk 17 1.5 Modifying SAS Data 18 1.5.1 Creating and Modifying Variables 18 1.5.2 Deleting Variables 21 1.5.3 Deleting Observations 21 1.5.4 Subsetting Data Sets 22 1.5.5 Concatenating and Merging Data Sets 22 1.5.6 Merging, Data Sets: Adding Variables 23 1.5.7 The Operation of the Data Step 24 1.6 The proc Step 25 1.6.1 The proc Statement 25 1.6.2 The var Statement 25 vii

viii A Handbook of Statistical Analyses Using SAS, Second Edition 1.6.3 The where Statement 25 1.6.4 The by Statement 26 1.6.5 The class Statement 26 1.7 Global Statements 26 1.8 ODS: The Output Delivery System 28 1.9 SAS Graphics 28 1.9.1 Proc gplot 28 1.9.2 Overlaid Graphs 31 1.9.3 Viewing and Printing Graphics 31 1.10 Some Tips for Preventing and Correcting Errors 32 2 Data Description and Simple Inference: Mortality and Water Hardness in the U.K 35 2.1 Description of Data -35 2.2 Methods of Analysis 36 2.3 Analysis Using SAS 36 Exercises 55 3 Simple Inference for Categorical Data: From Sandflies to Organic Particulates in the Air 57 3.1 Description of Data 57 3.2 Methods of Analysis 60 3.3 Analysis Using SAS 61 3.3.1 Cross-Classifying Raw Data 61 3.3.2 Sandflies 63 3-3.3 Acacia Ants 66 3-3-4 Piston Rings 68 3-3-5 Oral Contraceptives 70 3-3-6 Oral Cancers 72 3-3-7 Particulates and Bronchitis 75 Exercises 78 4 Multiple Regression: Determinants of Crime Rate in the United States 79 4.1 Description of Data 79 4.2 The Multiple Regression Model 81 4.3 Analysis Using SAS 83 Exercises 99 5 Analysis of Variance I: Treating Hypertension 101 5.1 Description of Data 101 5.2 Analysis of Variance Model 102 5.3 Analysis Using SAS 103 A;-..

Contents ix Exercises 116 6 Analysis of Variance II: School Attendance Amongst Australian Children 117 6.1 Description of Data 117 6.2 Analysis of Variance Model 119 6.2.1 Type I Sums of Squares 120 6.2.2 Type III Sums of Squares 120 6.3 Analysis Using SAS 122 Exercises 130 7 Analysis of Variance of Repeated Measures: Visual Acuity 131 7.1 Description of Data 131 7.2 Repeated Measures Data 131 7.3 Analysis of Variance for Repeated Measures Designs 133 7.4 Analysis Using SAS 134 Exercises...; 142 8 Logistic Regression: Psychiatric Screening, Plasma Proteins, and Danish Do-It-Yourself ". 143 8.1 Description of Data 143 8.2 The Logistic Regression Model 146 8.3 Analysis Using SAS 147 8.3.1 GHQ Data 147 8.3-2 ESR and Plasma Levels 153 8.3-3 Danish Do-It-Yourself 158 Exercises 164 9 Generalised Linear Models: School Attendance Amongst Australian School Children 165 9.1 Description of Data 165 9.2 Generalised Linear Models 165 9.2.1 Model Selection and Measure of Fit 168 9-3 Analysis Using SAS 169 Exercises 176 10 Longitudinal Data I: The Treatment of Postnatal Depression 179 10.1 Description of Data 179 10.2 The Analyses of Longitudinal Data 181 10.3 Analysis Using SAS 181 10.3.1 Graphical Displays 184 10.3.2 Response Feature Analysis 188 Exercises 195

x A Handbook of Statistical Analyses Using SAS, Second Edition 11 Longitudinal Data II: The Treatment of Alzheimer's Disease 197 11.1 Description of Data 197 11.2 Random Effects Models 199 11.3 Analysis Using SAS 201 Exercises 212 12 Survival Analysis: Gastric Cancer and Methadone Treatment of Heroin Addicts 213 12.1 Description of Data 213 12.2 Describing Survival and Cox's Regression Model 218 12.2.1 Survival Function 218 12.2.2 Hazard Function 219 12.2.3 Cox's Regression 220 12.3 Analysis Using SAS 222 12.3.1 Gastric Cancer 222 12.3.2 Methadone Treatment of Heroin Addicts 229 Exercises 235 13 Principal Components Analysis and Factor Analysis: The Olympic Decathlon and Statements about Pain 237 13-1 Description of Data 237 13-2 Principal Components and Factor Analyses 239 13-2.1 Principal Components Analysis 239 13.2.2 Factor Analysis 241 13-2.3 Factor Analysis and Principal Components Compared 242 13.3 Analysis Using SAS 243 13.3-1 Olympic Decathlon 243 13-3.2 Statements about Pain 252 Exercises 261 14 Cluster Analysis: Air Pollution in the U.S.A 263 14.1 Description of Data 263 14.2 Cluster Analysis 265 14.3 Analysis Using SAS 266 Exercises 284 15 Discriminant Function Analysis: Classifying Tibetan Skulls 287 15.1 Description of Data 287 15.2 Discriminant Function Analysis 289 15.3 Analysis Using SAS 291 Exercises 304

Contents xi 16 Correspondence Analysis: Smoking and Motherhood, Sex and the Single Girl, and European Stereotypes 305 16.1 Description of Data 305 16.2 Displaying Contingency Table Data Graphically Using Correspondence Analysis 307 16.3 Analysis Using SAS 310 16.3.1 Boyfriends., 310 16.3.2 Smoking and Motherhood 315 16.3-3 Are the Germans Really Arrogant? 319 Exercises 325 Appendix A: SAS Macro to Produce Scatterplot Matrices 327 Appendix B: Answers to Selected Chapter Exercises 331 References 347 Index 351