Preface |
|
xiii | |
Acknowledgments |
|
xv | |
|
|
1 | (23) |
|
|
1 | (1) |
|
Computing with SAS: An Illustrative Example |
|
|
2 | (5) |
|
|
7 | (4) |
|
|
11 | (2) |
|
Overview of the SAS DATA Step |
|
|
13 | (1) |
|
|
14 | (1) |
|
|
15 | (3) |
|
|
18 | (6) |
|
|
19 | (5) |
|
|
24 | (45) |
|
|
24 | (1) |
|
|
24 | (5) |
|
More Descriptive Statistics |
|
|
29 | (9) |
|
Histograms, QQ Plots, and Probability Plots |
|
|
38 | (3) |
|
Descriptive Statistics Broken Down by Subgroups |
|
|
41 | (2) |
|
|
43 | (2) |
|
|
45 | (13) |
|
|
58 | (11) |
|
|
64 | (5) |
|
Analyzing Categorical Data |
|
|
69 | (54) |
|
|
69 | (1) |
|
Questionnaire Design and Analysis |
|
|
70 | (5) |
|
|
75 | (2) |
|
Adding ``Value Labels'' (Formats) |
|
|
77 | (5) |
|
|
82 | (3) |
|
Using a Format to Recode a Variable |
|
|
85 | (2) |
|
|
87 | (4) |
|
A Shortcut Way to Request Multiple Tables |
|
|
91 | (1) |
|
Computing Chi-square from Frequency Counts |
|
|
92 | (1) |
|
A Useful Program for Multiple Chi-square Tables |
|
|
93 | (1) |
|
A Useful Macro for Computing Chi-square from Frequency Counts |
|
|
94 | (1) |
|
McNemar's Test for Paired Data |
|
|
95 | (4) |
|
Computing the Kappa Statistics (Coefficient of Agreement) |
|
|
99 | (1) |
|
|
100 | (4) |
|
|
104 | (2) |
|
Chi-square Test for Trend |
|
|
106 | (2) |
|
Mantel-Haenszel Chi-square for Stratified Tables and Meta-analysis |
|
|
108 | (3) |
|
``Check All That Apply'' Questions |
|
|
111 | (12) |
|
|
114 | (9) |
|
Working with Date and Longitudinal Data |
|
|
123 | (36) |
|
|
123 | (1) |
|
Processing Date Variables |
|
|
123 | (6) |
|
Working with Two-digit Year Values (the Y2K Problem) |
|
|
129 | (1) |
|
|
129 | (4) |
|
Selecting the First or Last Visit per Patient |
|
|
133 | (2) |
|
Computing Differences between Observations in a Longitudinal Data Set |
|
|
135 | (3) |
|
Computing the Difference between the First and Last Observation for Each Subject |
|
|
138 | (2) |
|
Computing Frequencies on Longitudinal Data Sets |
|
|
140 | (1) |
|
Creating Summary Data Sets with Proc Means or Proc Summary |
|
|
141 | (12) |
|
Outputting Statistics Other Than Means |
|
|
153 | (6) |
|
|
154 | (5) |
|
Correlation and Simple Regression |
|
|
159 | (24) |
|
|
159 | (1) |
|
|
160 | (2) |
|
Significance of a Correlation Coefficient |
|
|
162 | (2) |
|
How to Interpret a Correlation Coefficient |
|
|
164 | (1) |
|
|
165 | (1) |
|
|
166 | (3) |
|
Partitioning the Total Sum of Squares |
|
|
169 | (1) |
|
Producing a Scatter Plot and the Regression Line |
|
|
170 | (3) |
|
Adding a Quadratic Term to the Regression Equation |
|
|
173 | (1) |
|
|
174 | (9) |
|
|
179 | (4) |
|
T-tests and Nonparametric Comparisons |
|
|
183 | (16) |
|
|
183 | (1) |
|
T-test: Testing Differences between Two Means |
|
|
183 | (3) |
|
Random Assignment of Subjects |
|
|
186 | (4) |
|
Two Independent Samples: Distribution-free Tests |
|
|
190 | (3) |
|
One-tailed versus Two-tailed Tests |
|
|
193 | (1) |
|
Paired T-tests (Related Samples) |
|
|
194 | (5) |
|
|
196 | (3) |
|
|
199 | (37) |
|
|
199 | (1) |
|
One-way Analysis of Variance |
|
|
199 | (9) |
|
|
208 | (1) |
|
Analysis of Variance: Two Independent Variables |
|
|
209 | (5) |
|
Interpreting Significant Interactions |
|
|
214 | (8) |
|
|
222 | (1) |
|
Unbalanced Designs: Proc GLM |
|
|
223 | (4) |
|
|
227 | (9) |
|
|
231 | (5) |
|
Repeated Measures Designs |
|
|
236 | (46) |
|
|
236 | (1) |
|
|
237 | (6) |
|
Using the Repeated Statement of Proc Anova |
|
|
243 | (2) |
|
Using Proc Mixed to Compute a Mixed (Random Effects) Model |
|
|
245 | (2) |
|
Two-factor Experiments with Repeated Measures on One Factor |
|
|
247 | (11) |
|
Two-factor Experiments with Repeated Measures on Both Factors |
|
|
258 | (3) |
|
Three-factor Experiments with a Repeated Measure on the Last Factor |
|
|
261 | (7) |
|
Three-factor Experiments with Repeated Measures on Two Factors |
|
|
268 | (14) |
|
|
278 | (4) |
|
Multiple-Regression Analysis |
|
|
282 | (38) |
|
|
282 | (1) |
|
|
283 | (5) |
|
Nonexperimental Regression |
|
|
288 | (3) |
|
Stepwise and Other Variable Selection Methods |
|
|
291 | (7) |
|
Creating and Using Dummy Variables |
|
|
298 | (2) |
|
Using the Variance Inflation Factor to Look for Multicollinearity |
|
|
300 | (1) |
|
|
300 | (14) |
|
Automatic Creation of Dummy Variables with Proc Logistic |
|
|
314 | (6) |
|
|
315 | (5) |
|
|
320 | (16) |
|
|
320 | (1) |
|
|
320 | (1) |
|
Principal Components Analysis |
|
|
321 | (9) |
|
|
330 | (1) |
|
Using Communalities Other Than One |
|
|
331 | (2) |
|
How to Reverse Item Scores |
|
|
333 | (3) |
|
|
335 | (1) |
|
|
336 | (17) |
|
|
336 | (1) |
|
Using SAS to Score a Test |
|
|
336 | (3) |
|
Generalizing the Program for a Variable Number of Questions |
|
|
339 | (3) |
|
Creating a Better-looking Table Using Proc Tabulate |
|
|
342 | (3) |
|
A Complete Test-scoring and Item-analysis Program |
|
|
345 | (3) |
|
|
348 | (1) |
|
|
349 | (4) |
|
|
350 | (3) |
|
|
353 | (23) |
|
|
353 | (1) |
|
List Input: Data Values Separated by Spaces |
|
|
353 | (1) |
|
Reading Comma-delimited Data |
|
|
354 | (1) |
|
Using Informats with List Input |
|
|
355 | (2) |
|
|
357 | (1) |
|
|
357 | (2) |
|
Reading More Than One Line per Subject |
|
|
359 | (1) |
|
Changing the Order and Reading a Column More than Once |
|
|
359 | (1) |
|
|
360 | (1) |
|
``Holding the Line''---Single-and Double-trailing @s |
|
|
361 | (1) |
|
Suppressing the Error Messages for Invalid Data |
|
|
362 | (1) |
|
Reading ``Unstructured'' Data |
|
|
363 | (13) |
|
|
370 | (6) |
|
External Files: Reading and Writing Raw and System Files |
|
|
376 | (27) |
|
|
376 | (1) |
|
Data in the Program Itself |
|
|
377 | (1) |
|
Reading Data from an External Text File (ASCII or EBCDIC) |
|
|
378 | (2) |
|
|
380 | (4) |
|
Reading Data from Multiple Files (Using Wildcards) |
|
|
384 | (1) |
|
Writing ASCII or Raw Data to an External File |
|
|
385 | (1) |
|
Writing CSV (Comma-separated Variables) Files Using SAS |
|
|
386 | (1) |
|
Creating a Permanent SAS Data Set |
|
|
387 | (1) |
|
Reading Permanent SAS Data Sets |
|
|
388 | (2) |
|
How to Determine the Contents of a SAS Data Set |
|
|
390 | (1) |
|
Permanent SAS Data Sets with Formats |
|
|
391 | (1) |
|
Working with Large Data Sets |
|
|
392 | (11) |
|
|
400 | (3) |
|
Data Set Subsetting, Concatenating, Merging, and Updating |
|
|
403 | (14) |
|
|
403 | (1) |
|
|
403 | (2) |
|
Combining Similar Data from Multiple SAS Data Sets |
|
|
405 | (1) |
|
Combining Different Data from Multiple SAS Data Sets |
|
|
406 | (3) |
|
|
409 | (3) |
|
Updating a Master Data Set from an Update Data Set |
|
|
412 | (5) |
|
|
413 | (4) |
|
|
417 | (15) |
|
|
417 | (1) |
|
Substituting One Value for Another for a Series of Variables |
|
|
417 | (2) |
|
Extending Example 1 to Convert All Numeric Values of 999 to Missing |
|
|
419 | (1) |
|
Converting the Value of N/A (Not Applicable) to a Character Missing Value |
|
|
420 | (1) |
|
Converting Heights and Weights from English to Metric Units |
|
|
421 | (1) |
|
|
422 | (2) |
|
Using a Temporary Array to Score a Test |
|
|
424 | (2) |
|
|
426 | (1) |
|
Temporary Arrays and Array Bounds |
|
|
426 | (1) |
|
Implicitly Subscripted Arrays |
|
|
427 | (5) |
|
|
428 | (4) |
|
Restructuring SAS Data Sets Using Arrays |
|
|
432 | (12) |
|
|
432 | (1) |
|
Creating a New Data Set with Several Observations per Subject from a Data Set with One Observation per Subject |
|
|
433 | (2) |
|
Another Example of Creating Multiple Observations from a Single Observation |
|
|
435 | (1) |
|
Going from One Observation per Subject to Many Observations per Subject Using Multidimensional Arrays |
|
|
436 | (2) |
|
Creating a Data Set with One Observation per Subject from a Data Set with Multiple Observations per Subject |
|
|
438 | (2) |
|
Creating a Data Set with One Observation per Subject from a Data Set with Multiple Observations per Subject Using a Multidimensional Array |
|
|
440 | (4) |
|
|
441 | (3) |
|
A Review of SAS Functions: Functions Other than Character Functions |
|
|
444 | (13) |
|
|
444 | (1) |
|
Arithmetic and Mathematical Functions |
|
|
444 | (2) |
|
|
446 | (2) |
|
|
448 | (2) |
|
The INPUT and PUT Functions: Converting Numeric to Character and Character to Numeric Variables |
|
|
450 | (2) |
|
The LAG and DIF Functions |
|
|
452 | (5) |
|
|
453 | (4) |
|
A Review of SAS Functions: Character Functions |
|
|
457 | (23) |
|
|
457 | (1) |
|
How Lengths of Character Variables Are Set in a SAS Data Step |
|
|
458 | (2) |
|
|
460 | (1) |
|
How to Remove Characters from a String |
|
|
461 | (1) |
|
Character Data Verification |
|
|
462 | (1) |
|
|
463 | (1) |
|
Using the Substr Function on the Left-hand Side of the Equal Sign |
|
|
464 | (1) |
|
Doing the Previous Example Another Way |
|
|
465 | (1) |
|
|
465 | (1) |
|
|
466 | (1) |
|
Locating the Position of One String Within Another String |
|
|
467 | (1) |
|
Changing Lowercase to Uppercase and Vice Versa |
|
|
468 | (1) |
|
Substituting One Character for Another |
|
|
469 | (1) |
|
Substituting One Word for Another in a String |
|
|
470 | (1) |
|
Concatenating (Joining) Strings |
|
|
471 | (1) |
|
|
472 | (1) |
|
Spelling Distance: The Spedis Function |
|
|
473 | (7) |
|
|
474 | (6) |
|
Selected Programming Examples |
|
|
480 | (15) |
|
|
480 | (1) |
|
Expressing Data Values as a Percentage of the Grand Mean |
|
|
480 | (2) |
|
Expressing a Value as a Percentage of a Group Mean |
|
|
482 | (1) |
|
Plotting Means with Error Bars |
|
|
483 | (2) |
|
Using a Macro Variable to Save Coding Time |
|
|
485 | (1) |
|
Computing Relative Frequencies |
|
|
485 | (2) |
|
Computing Combined Frequencies on Different Variables |
|
|
487 | (2) |
|
Computing a Moving Average |
|
|
489 | (2) |
|
Sorting Within an Observation |
|
|
491 | (1) |
|
Computing Coefficient Alpha (or KR-20) in a Data Step |
|
|
492 | (3) |
|
|
494 | (1) |
|
|
495 | (9) |
|
|
495 | (1) |
|
|
496 | (1) |
|
|
496 | (1) |
|
|
496 | (1) |
|
|
497 | (1) |
|
|
497 | (1) |
|
|
497 | (1) |
|
|
498 | (1) |
|
|
498 | (1) |
|
|
499 | (1) |
|
|
499 | (1) |
|
|
499 | (1) |
|
|
500 | (1) |
|
|
500 | (1) |
|
|
500 | (1) |
|
|
501 | (1) |
|
|
501 | (1) |
|
|
502 | (1) |
|
|
502 | (1) |
|
|
503 | (1) |
|
|
503 | (1) |
|
|
503 | (1) |
|
|
503 | (1) |
Solutions to Odd-Numbered Problems |
|
504 | (59) |
Index |
|
563 | |