看到有人再找这本书,发上来给大家分享,但不知道这次是不是能上传成功,刚才几个的附件都没有添加成功,如果这次还不行,请大家指教一下先~
Contents
Applied Statistics and SAS Software
Chapter 1 A SAS Tutorial 1
Introduction 1
Computing with SAS Software: An Illustrative Example 2
Enhancing the Program 7
SAS Procedures 10
Overview of the SAS Data Step 13
synt& of SAS Procedures 13
Comment Statements 15
References 18
Chapter 2 Describing Data 22
Introduction 22
Describing Data 22
More Descriptive Statistics 26
Descriptive Statistics Broken Down by Subgroups 32
Frequency Distributio~ls 34
Bar Graphs 35
Plotting Data 42
Creating Summary Data Sets with PROC MEANS and PROC UNIVARIAE 45
Outputting Statistics Other Than Means 53
Creating a Summary Data Set Containing a Median 54
Chapter 3 Analyzing Categorical Data 58
Introduction 58
Questionnaire Design and Analysis 59
Adding Variable Labels 63
Adding "Value Labels" (Formats) 66
Recoding Data 70
Using a Format to Recode a Variable 73
Two-way Frequency Tables 75
A Short-cut Way of Requesting Multiple Tables 78
Contents
viii
1. Computing Chi-square from Frequency Counts 79
J. A Useful Program for Multple Chi-square Tables 80
K. McNemar'sTest for Paired Data 81
L. Odds Ratios 83
M. Relative Risk 86
N. Chi-square Test for Trend 88
0 . Mantel-Haenszel Chi-square for Stratified Tables and Meta Analysis 90
I? "Check All ?hat Apply" Questions 92
Chapter 4 Working with Date and Longitudinal Data 101
A. Introduction 101
B. Processing Date Variables 101
C. Longitudinal Data 106
D. Most Recent (or Last) Visit per Patient 109
E. Computing Frequencies on Longitudinal Data Sets 110
Chapter 5 Correlation and Regression 115
A. Introduction 115
B. Correlation 115
C. Significance of a Correlation Coefficient 118
D. How to Interpret a Correlation Coefficient 119
E. Partial Correlations 120
F. Linear Regression 121
G. Partitioning the Total Sum of Squares 124
H. Plotting the Points on the Regression Line 125
1. Rotting Residuals and Confidence Limits 126
J. Adding a Quadratic Term to the Regression Equation 128
K. Transforming Data 129
L. Computing Within-subject Slopes 133
Chapter 6 T-tests and Nonparametric Comparisons 138
Introduction 138
A.
B. T-test: Testing Differences between ' h o Means 138
C. Random Assignment of Subjects 141
D. %o Independent Samples: Distribution Free Tests 143
One-tailed versus ltvo-tailed Tests 145
E.
F. Paired T-tests (Related Samples) 146
Chapter 7 Analysis of Variance 150
A. Introduction 150
B. One-way Analysis of Variance 150
C. Computing Contrasts 158
D. Analysis of Variance: Two Independent Variables 159
Interpreting Significant Interactions 163
E.
F. N-way Factorial Designs 170
G. Unbalanced Designs: PROC CLM 171
H. Analysis of Covariance 174
Repeated Measures Deslgns 181
Chapter 8
A. Introduction 181
B. One-factor Experiments 182
Using the REPEATED Statement of P R O ~ A N O V A 168
C.
-0-factor Experiments with a Repeated Measure on One Factor 189
D.
E. Two-factor Experiments with Repeated Measures on Both Factors 197
F. Three-factor Experiments with a Repeated Measure on the Last
Factor 202
G. Three-factor Experiments with Repeated Measures o n m o Factors 209
Chapter 9 Multiple-Regression Analysis 221
A. Introduction 221
B. Designed Regression 226
C. Nonexperimental Regression 226
D. Stepwise and Other Variable Selection Methods 228
E. Creating and Using Dummy Variables 234
F. Logistic Regression 235
Chapter 10 Factor Analysis 250
A. Introduction 250
B. Qpes of Factor Analysis 250
C. Principal Components Analysis 251
D. Oblique Rotations 258
E. Using Communalities Other Than One 259
F. How to Reverse Item Scores 262
Chapter 11 Psychometrics 265
A. Introduction 265
B. Using SAS Software to Score a Test 265
Generalizing the Program for a Variable Number of Questions 268
C.
D. Creating a Better Looking Table Using PROCTABULATE 270
E. A Complete Test Scoring and Item Analysis Program 273
F. Test Reliability 276
Interrater Reliability 277
G. SAS Programming
Chapter 12 The SAS INPUT Statement 280
Introduction 280
List Directed Input: Data values separated by spaces 280
Reading Comma-delimited Data 28 1
Using INFORMATS with List Directed Data 282
Column Input 283
Pointers and Informats 284
Reading More than One Line per Subject 285
Changing the Order and Reading a Column More Than Once 286
Informat Lists 286
"Holding the Linen-Single- and Double-trailing 0 ' s 287
Suppressing the Error Messages for Invalid Data 288
Reading "Unstructured Data 289
Chapter 13 External Files: Reading and Writing Raw and System Files 298
A. Introduction 298
B. Data in the Program Itself 298
C. Reading ASCII Data from an External File 300
D. INFILE Options 302
E. Writing ASCII or Raw Data to an External File 304
F. Creating a Permanent SAS Data Set 305
G. Reading Permanent SAS Data Sets 307
H. How to Determine the Contents of a SAS Data Set 308
I. Permanent SAS Data Sets with Formats 309
J. Working with Large Data Sets 311
Chapter 14 Data Set Subsetting, Concatenating, Merging, and Updating 319
A. Infroduction 319
B. Subsetting 319
C. Combining Similar Data from Multiple SAS Data Sets 321
D. Combining Different Data from Multiple SAS Data Sets 321
E. "Table Look up" 324
F. Updating a Master Data Set from an Update Data Set 326
Chapter 15 Working with Arrays 329
A. Introduction 329
B. Substituting One Value for Another for a Series of Variables 329
C. Extending Example 1 to Convert All Numeric Values of 999 to
Missing 331
D. Converting the Value of N/A (Not Applicable) to a Character Missing
Value 332
Converting Heights and Weights from English to Metric Units 333
E.
F. Temporary Arrays 334
G. Using a Temporary Array to Score a Test 336
H. Specifying Array Bounds 338
I. Temporary Arrays and Array Bounds 338
Implicitly Subscripted Arrays 339
J.
Chapter 16 Restructuring SAS Data Sets Using Arrays 343
A. Introduction 343
B. Creating a New Data Set with Several Observations per Subject from a
Data Set with One Observation per Subject 343
C. Another Example of Creating Multiple Observations from a Single
Observation 345
D. Going from One Observation per Subject to Many Observations per
Subject Using Multi-dimensional Arrays 347
E. Creating a Data Set with One Observation per Subject from a Data
Set with Multiple Observations per Subject 348
F, Creating a Data Set with One Observation per Subject from a Data
Set with Multiple Observations per Subject Using a Multi-dimensional
Array 350
Chapter 17 A Review of SAS Functions:
Part I. Functions other than character functions 353
A. Introduction 353
B. Arithmetic and Mathematical Functions 353
C. Random Number Functions 355
D. Time and Date Functions 356
The INPUT and PUT Functions: Converting Numerics to Character, and
E.
Character to Numeric Variables 358
F. The LAG and DIF Functions 360
Chapter 18 A Review of SAS Functions:
Part 11. Character Functions 364
A. Introduction 364
How Lengths of Character Variables Are Set in a SAS Data Step 364
B.
C. Working with Blanks 367
D. How to Remove Characters from a String 368
E. Character Data Verification 368
F. Substring Example 369
Using the SUBSTR Function on the Left-hand Side of the Equal Sign
G.
370
H. Doing the Previous Example Another Way 371
I. Unpacking a String 372
Parsing a String 373
J.
Locating the Position of One String within Another String 373
K.
xii Contents
L. Changing Lower Case to Upper Case and Vice Versa 374
M. Substituting One Character for Another 375
N. Substituting One Word for Another in a String 376
0 . Concatenating (Joining) Strings 377
P. Soundex Conversion 378
Chapter 19 Seiected Programming Exampies 382
A. Introduction 382
B. Expressing Data Values as a Percentage of the Grand Mean 382
C. Expressing a Value as a Percentage of a Group Mean 384
D. Plotting Means with Error Bars 385
E. Using a Macro Variable to Save Coding T ~ m e 386
F. Computing Relative Frequencies 387
G. Computing Combined Frequencies on Different Variables 389
H. Computing a Moving Average 391
1. Sorting within an Observation 392
J. Computing CoefficientAlphs (or KR-20) a Data Step 393
in
Chapter 20 Syntax Exampies 395
Introduction 395 400
PROC LOGISTIC
PROC ANOVA 396 400
PROCMEANS
PROC APPEND 396 PROC NPARl WAY 401
PROC CHART 396 PROC PLOT 401
PROC CONTENTS 397 PROC PRINT 401
PROC CORR 397 402
PROCRANK
PROC DATASErj 397 PROCREC 402
PROC FACTOR 398 PRW SORT 403
PROC FORMAT 398 PROCTTEST 403
PROC FREQ 399 PROC UNIVARIATE 403
PROCCLM 399
Problem Solutions 404
Index 439