第 2 页
SPSS for Beginners Copyright © 1999 Vijay Gupta Published by VJBooks Inc. All rights reserved. No part of this book may be used or reproduced in any form or by any means, or stored in a database or retrieval system, without prior written permission of the publisher except in the case of brief quotations embodied in reviews, articles, and research papers. Making copies of any part of this book for any purpose other than personal use is a violation of United States and international copyright laws. For information contact Vijay Gupta at vgupta1000@aol.com. You can reach the author at vgupta1000@aol.com. The author welcomes feedback but will not act as a help desk for the SPSS program. Library of Congress Catalog No.: Pending ISBN: Pending First year of printing: 1999 Date of this copy: Dec 15, 1999 This book is sold as is, without warranty of any kind, either express or implied, respecting the contents of this book, including but not limited to implied warranties for the book's quality, performance, merchantability, or fitness for any particular purpose. Neither the author, the publisher and its dealers, nor distributors shall be liable to the purchaser or any other person or entity with respect to any liability, loss, or damage caused or alleged to be caused directly or indirectly by the book. This book is based on SPSS versions 7.x through 10.0. SPSS is a registered trademark of SPSS Inc. Publisher: VJBooks Inc. Editor: Vijay Gupta Author: Vijay Gupta www.vgupta.com
第 3 页
About the Author Vijay Gupta has taught statistics, econometrics, SPSS, LIMDEP, STATA, Excel, Word, Access, and SAS to graduate students at Georgetown University. A Georgetown University graduate with a Masters degree in economics, he has a vision of making the tools of econometrics and statistics easily accessible to professionals and graduate students. At the Georgetown Public Policy Institute he received rave reviews for making statistics and SPSS so easy and "non-mathematical." He has also taught statistics to institutions in the US and abroad. In addition, he has assisted the World Bank and other organizations with econometric analysis, survey design, design of international investments, cost-benefit and sensitivity analysis, development of risk management strategies, database development, information system design and implementation, and training and troubleshooting in several areas. Vijay has worked on capital markets, labor policy design, oil research, trade, currency markets, transportation policy, market research and other topics on The Middle East, Africa, East Asia, Latin America, and the Caribbean. He has worked in Lebanon, Oman, Egypt, India, Zambia, and the U.S. He is currently working on: • a package of SPSS Scripts "Making the Formatting of Output Easy" • a manual on Word • a manual for Excel • a tutorial for E-Views • an Excel add-in titled "Tools for Enriching Excel's Data Analysis Capacity" • a Graphical User Interface for basic SAS. Expect them to be available during Early 2000. Early versions can be downloaded from www.vgupta.com. www.vgupta.com
第 5 页
Acknowledgments To SPSS Inc, for their permission to use screen shots of SPSS. To the brave souls who have to learn statistics! Dedication To my Grandmother, the late Mrs. Indubala Sukhadia, member of India's Parliament. The greatest person I will ever know. A lady with more fierce courage, radiant dignity, and leadership and mentoring abilities than any other. Any Feedback is Welcome You can e-mail Vijay Gupta at vgupta1000@aol.com. www.vgupta.com
第 6 页
Table of Contents Table of Contents- 1 TABLE OF CONTENTS Contents INTRODUCTION.............................................................................................................................................I Merits of the Book...................................................................................................................................i Organization of the Chapters...................................................................................................................i Conventions Used in this Book .............................................................................................................iv Quick Reference and Index: Relation Between SPSS Menu Options and the Sections in the Book ............................................. …………………………………………………………………iv 1. Data Handling .................................................................................................................................1 1. 1 Reading (Opening) the Data Set ................................................................................................2 1. 2 Defining the Attributes of Variables..........................................................................................5 1. 3 Weighing Cases .......................................................................................................................21 1. 4 Creating a Smaller Data Set by Aggregating Over a Variable.................................................21 1. 5 Sorting .....................................................................................................................................28 1. 6 Reducing Sample Size .............................................................................................................29 1. 7 Filtering Data...........................................................................................................................32 1. 8 Replacing Missing Values .......................................................................................................40 1. 9 Using Sub-sets of Variables (And Not of Cases, as in 1.7) .....................................................42 2. Creating New Variables ..............................................................................................................2-1 2. 1 Creating Dummy, Categorical, and Semi-Continuos Variables….. .......................................2-2 2. 2 Using Mathematical Computations to Create New Continuous Variables: Compute ............................................................................................................................................2-19 2. 3 Multiple Response Sets - Using a "Set" Variable Consisting of Several Categorical Variables ........................................................................................................................2-25 2. 4 Creating a "Count" Variable to Add the Number of Occurrences of Similar Values Across a Group of Variables .................................................................................................2-31 2. 5 Continuous Variable Groupings Created Using Cluster Analysis ........................................2-33 3. Univariate Analysis......................................................................................................................3-1 3. 1 Graphs (Bar, Line, Area, and Pie) ..........................................................................................3-2 3. 2 Frequencies and Distributions ................................................................................................3-8 3. 3 Other Basic Univariate Procedures (Descriptives and Boxplots) .........................................3-20 3. 4 Testing if the Mean is Equal to a Hypothesized Number (the T-Test and Error Bar) .............................................................................................................................................3-23 4. Comparing Similar Variables.....................................................................................................4-1 4. 1 Graphs (Bar, Pie) ....................................................................................................................4-1 www.vgupta.com
第 7 页
Table of Contents Table of Contents- 2 4. 2 Boxplots..................................................................................................................................4-3 4. 3 Comparing Means and Distributions ......................................................................................4-5 5. Multivariate Statistics..................................................................................................................5-1 5. 1 Graphs.....................................................................................................................................5-2 5. 2 Scatters .................................................................................................................................5-16 5. 3 Correlations ..........................................................................................................................5-22 5. 4 Conducting Several Bivariate Explorations Simultaneously ................................................5-29 5. 5 Comparing the Means and Distributions of Sub-Groups of a Variable - Error Bar, T-Test, ANOVA, and Non-parametric Tests .............................................................................5-39 6. Tables............................................................................................................................................6-1 6. 1 Tables for Statistical Attributes ..............................................................................................6-1 6. 2 Tables of Frequencies ...........................................................................................................6-12 7. Linear Regression ........................................................................................................................7-1 7. 1 Linear Regression ...................................................................................................................7.2 7. 2 Interpretation of Regression Results.......................................................................................7-9 7. 3 Problems Caused by the Breakdown of Classical Assumptions ...........................................7-16 7. 4 Diagnostics ...........................................................................................................................7-17 7. 5 Formally Testing for Heteroskedasticity: White’s Test ........................................................7-21 8. Correcting for Breakdown of Classical Assumptions...............................................................8-1 8. 1 Correcting for Collinearity .....................................................................................................8-3 8. 2 Correcting for Heteroskedasticity...........................................................................................8-5 8. 3 Correcting for Incorrect Functional Form.............................................................................8-11 8. 4 Correcting for Simultaneity Bias: 2SLS ...............................................................................8-18 8. 5 Correcting for other Breakdowns .........................................................................................8-22 9. MLE: Logit and Non-linear Regression.....................................................................................9-1 9. 1 Logit .......................................................................................................................................9-1 9. 1 Non-linear Regression ............................................................................................................9-7 10. Comparative Analysis................................................................................................................10-1 10. 1 Using Split File to Compare Results.....................................................................................10-2 11. Formatting and Editing Output ...............................................................................................11-1 11. 1 Formatting and Editing Tables .............................................................................................11-1 11. 2 Formatting and Editing Charts............................................................................................11-18 12. Reading ASCII Text Data .........................................................................................................12-1 12. 1 Understanding ASCII Text Data...........................................................................................12-1 www.vgupta.com
第 8 页
Table of Contents Table of Contents- 3 12. 2 Reading Data Stored in ASCII Tab-delimited Format..........................................................12-3 12. 3 Reading Data Stored in ASCII Delimited (or Freefield) Format other than Tab- delimited............................................................................................................................................12-4 12. 4 Reading Data Stored in Fixed Width (or Column) Format ..............................……………12-6 13. Merging: Adding Cases & Variables .......................................................................................13-1 13. 1 Adding New Observations....................................................................................................13-1 13. 2 Adding New Variables (Merging) ........................................................................................13-4 14. Non-parametric Testing ............................................................................................................14-1 14. 1 Binomial Test .......................................................................................................................14-1 14. 2 Chi-square.............................................................................................................................14-5 14. 3 The Runs Test - Determining Whether a Variable is Randomly Distributed .....................14-10 15. Setting System Defaults .............................................................................................................15-1 15. 1 General Settings....................................................................................................................15-1 15. 2 Choosing the Default View of the Data and Screen .............................................................15-4 16. Reading Data from Database Formats ....................................................................................16-1 17. Time Series Analysis..................................................................................................................17-1 17. 1 Sequence Charts (Line Charts with Time on the X-Axis) ....................................................17-4 17. 2 Checking for Unit Roots / Non-stationarity (PACF) ..........................................................17-10 17. 3 Determining Lagged Effects of other Variables (CCF) ......................................................17-21 17. 4 Creating New Variables (Using Time Series Specific Formulae: Difference, Lag, etc. ..........................................................................................................................................17-27 17. 5 ARIMA...............................................................................................................................17-30 17. 6 Correcting for First-order Autocorrelation Among Residuals (AUTOREGRESSION)...................................................................................................................17-35 17. 7 Co-integration.....................................................................................................................17-38 18. Programming without programming (using Syntax and Scripts)…….. .............................................18-1 18.1 Using SPSS Scripts…...........................................................................................................18-1 18.2 Using SPSS Syntax…...........................................................................................................18-4 www.vgupta.com
第 9 页
Table of Contents Table of Contents- 4 Detailed Contents Merits of the Book ...............................................................................................................................................i Organization of the Chapters .............................................................................................................................i Conventions Used in this Book .........................................................................................................................iv 1. DATA HANDLING........................................................................................................................1-1 1.1 Reading (Opening) the Data Set .................................................................................................1-2 1.1.A. Reading SPSS Data ................................................................................................................1-2 1.1.B. Reading Data from Spreadsheet Formats - e.g. - Excel ..........................................................1-3 1.1.C. Reading Data from Simple Database Formats - e.g. - Dbase..................................................1-4 1.1.D. Reading Data from other Statistical Programs (SAS, STATA, etc.) ......................................1-4 1.2 Defining the Attributes of Variables ..........................................................................................1-5 1.2.A. Variable Type .........................................................................................................................1-6 1.2.B. Missing Values .....................................................................................................................1-10 1.2.C. Column Format.....................................................................................................................1-13 1.2.D. Variable Labels.....................................................................................................................1-14 1.2.E. Value Labels for Categorical and Dummy Variables ...........................................................1-16 1.2.F. Perusing the Attributes of Variables.....................................................................................1-19 1.2.G. The File Information Utility .................................................................................................1-20 1.3 Weighing Cases ..........................................................................................................................1-21 1.4 Creating a Smaller Data Set by Aggregating Over a Variable ..............................................1-21 1.5 Sorting.........................................................................................................................................1-28 1.6 Reducing Sample Size................................................................................................................1-29 1.6.A. Using Random Sampling......................................................................................................1-29 1.6.B. Using a Time/Case Range ....................................................................................................1-31 1.7 Filtering Data .............................................................................................................................1-32 1.7.A. A Simple Filter .....................................................................................................................1-33 1.7.B. What to Do After Obtaining the Sub-set ..............................................................................1-35 1.7.C. What to Do After the Sub-set is No Longer Needed ............................................................1-36 www.vgupta.com
第 10 页
Table of Contents Table of Contents- 5 1.7.D. Complex Filter: Choosing a Sub-set of Data Based On Criterion from More than One Variable..............................................................................................................................1-36 1.8 Replacing Missing Values .........................................................................................................1-40 1.9 Using Sub-sets of Variables (and Not of Cases, as in 1.7).......................................................1-42 2. CREATING NEW VARIABLES......................................................................................................2-1 2.1 Creating Dummy, Categorical, and Semi-continuos Variables ..............................................2-2 2.1.A. What Are Dummy and Categorical Variables?.......................................................................2-2 2.1.B. Creating New Variables Using Recode ..................................................................................2-3 2.1.C. Replacing Existing Variables Using Recode ........................................................................2-12 2.1.D. Obtaining a Dummy Variable as a By-product of Filtering..................................................2-16 2.1.E. Changing a Text Variable into a Numeric Variable .............................................................2-17 2.2 Using Mathematical Computations to Create New Continuous Variables: Compute................................................................................................................................2-19 2.2.A. A Simple Computation .........................................................................................................2-20 2.2.B. Using Built-in SPSS Functions to Create a Variable............................................................2-22 2.3 Multiple Response Sets-- Using a "Set" Variable Consisting of Several Categorical Variables ..........................................................................................................2-25 2.4 Creating a "Count" Variable to Add the Number of Occurrences of Similar Values Across a Group of Variables...................................................................................2-31 2.5 Continuous Variable Groupings Created Using Cluster Analysis ........................................2-33 3. UNIVARIATE ANALYSIS..............................................................................................................3-1 3.1 Graphs (Bar, Line, Area and Pie)...............................................................................................3-2 3.1.A. Simple Bar Graphs..................................................................................................................3-2 3.1.B. Line Graphs ............................................................................................................................3-4 3.1.C. Graphs for Cumulative Frequency..........................................................................................3-6 3.1.D. Pie Graphs ..............................................................................................................................3-7 3.2 Frequencies and Distributions ....................................................................................................3-8 3.2.A. The Distribution of Variables - Histograms and Frequency Statistics....................................3-9 3.2.B. Checking the Nature of the Distribution of Continuous Variables .......................................3-13 3.2.C. Transforming a Variable to Make it Normally Distributed ..................................................3-16 www.vgupta.com
第 11 页
Table of Contents Table of Contents- 6 3.2.D. Testing for other Distributions..............................................................................................3-17 3.2.E. A Formal Test to Determine the Distribution Type of a Variable ........................................3-18 3.3 Other Basic Univariate Procedures (Descriptives and Boxplots) ..........................................3-20 3.3.A. Descriptives ..........................................................................................................................3-20 3.3.B. Boxplots................................................................................................................................3-22 3.4 Testing if the Mean is Equal to a Hypothesized Number (the T-Test and Error Bar)........................................................................................................................................3-23 3.4.C. Error Bar (Graphically Showing the Confidence Intervals of Means)..................................3-24 3.4.A. A Formal Test: The T-Test ...................................................................................................3-25 4. COMPARING SIMILAR VARIABLES ............................................................................................4-1 4.1 Graphs (Bar, Pie) .........................................................................................................................4-1 4.2 Boxplots ........................................................................................................................................4-3 4.3 Comparing Means and Distributions.........................................................................................4-5 4.3.A. Error Bars ...............................................................................................................................4-5 4.3.B. The Paired Samples T-Test.....................................................................................................4-9 4.3.C. Comparing Distributions when Normality Cannot Be Assumed - 2 Related Samples Non-parametric Test ...........................................................................................................4-12 5. MULTIVARIATE STATISTICS......................................................................................................5-1 5.1 Graphs ..........................................................................................................................................5-2 5.1.A. Graphing a Statistic (e.g. - the Mean) of Variable "Y" by Categories of X............................5-2 5.1.B. Graphing a Statistic (e.g. - the Mean) of Variable "Y" by Categories of "X" and "Z" ...............................................................................................................................................5-6 5.1.C. Using Graphs to Capture User-designed Criterion ...............................................................5-11 5.1.D. Boxplots................................................................................................................................5-14 5.2 Scatters .......................................................................................................................................5-16 5.2.A. A Simple Scatter...................................................................................................................5-16 5.2.B. Plotting Scatters of Several Variables Against Each other ...................................................5-17 5.2.C. Plotting Two X-Variables Against One Y ............................................................................5-19 5.3 Correlations................................................................................................................................5-22 5.3.A. Bivariate Correlations...........................................................................................................5-23 5.3.B. Non-parametric (Spearman's) Bivariate Correlation.............................................................5-26 www.vgupta.com
第 12 页
Table of Contents Table of Contents- 7 5.3.C. Partial Correlations ...............................................................................................................5-27 5.4 Conducting Several Bivariate ExplorationsSimultaneously ..................................................5-29 5.5 Comparing the Means and Distributions of Sub-groups of a Variable - Error Bar, T-Test, ANOVA, and Non-parametric Tests..................................................5-39 5.5.A. Error Bars .............................................................................................................................5-39 5.5.B. The Independent Samples T-Test .........................................................................................5-41 5.5.C. ANOVA (one-way) ..............................................................................................................5-45 5.5.D. Non-parametric Testing Methods .........................................................................................5-49 6. TABLES.......................................................................................................................................6-1 6.1 Tables for Statistical Attributes..................................................................................................6-1 6.1.A. Summary Measure of a Variable ............................................................................................6-1 6.1.B. Obtaining More Than One Summary Statistic........................................................................6-6 6.1.C. Summary of a Variable's Values Categorized by Three Other Variables ...............................6-9 6.2 Tables of Frequencies ................................................................................................................6-12 7. LINEAR REGRESSION.................................................................................................................7-1 7. 1 Linear Regression ........................................................................................................................7-2 7. 2 Interpretation of Regression Results..........................................................................................7-9 7. 3 Problems Caused by Breakdown of Classical Assumptions...................................................7-16 7. 4 Diagnostics..................................................................................................................................7-17 7. 4.A. Collinearity ...........................................................................................................................7-17 7. 4.B. Misspecification....................................................................................................................7-18 7. 4.C. Incorrect Functional Form ....................................................................................................7-19 7. 4.D. Omitted Variable. .................................................................................................................7-19 7. 4.E. Inclusion of an Irrelevant Variable. ......................................................................................7-20 7. 4.F. Measurement Error. ..............................................................................................................7-20 7. 4.G. Heteroskedasticity ................................................................................................................7-20 7. 5 Formally Testing for Heteroskedasticity: White’s Test .........................................................7-21 8. CORRECTING FOR BREAKDOWN OF CLASSICAL ASSUMPTIONS ..............................................8-1 www.vgupta.com
第 13 页
Table of Contents Table of Contents- 8 8. 1 Correcting for Collinearity .........................................................................................................8-3 8. 1.A. Dropping All But One of the Collinear Variables from the Model ........................................8-4 8. 2 Correcting for Heteroskedasticity ..............................................................................................8-5 8. 2.A. WLS When Exact Nature of Heteroskedasticity is Not Known .............................................8-5 8. 2.B. Weight Estimation When the Weight is Known.....................................................................8-9 8. 3 Correcting for Incorrect Functional Form..............................................................................8-11 8. 4 Correcting for Simultaneity Bias: 2SLS ..................................................................................8-18 8. 5 Correcting for Other Breakdowns ...........................................................................................8-22 8. 5.C. Omitted Variable ..................................................................................................................8-22 8. 5.A. Irrelevant Variable ................................................................................................................8-22 8. 5.B. Measurement Error in Dependent Variable ..........................................................................8-23 8. 5.C. Measurement Error in Independent Variable(s)....................................................................8-23 9. MLE: LOGIT AND NON-LINEAR REGRESSION..........................................................................9-1 9. 1 Logit ..............................................................................................................................................9-1 9. 1 Non-linear Regression .................................................................................................................9-8 9. 1.A. Curve Estimation ....................................................................................................................9-7 9. 1.B. General Non-linear Estimation (and Constrained Estimation) .............................................9-11 10. COMPARATIVE ANALYSIS........................................................................................................10-1 10. 1 Using Split File to Compare Results.........................................................................................10-2 10. 1.A. Example of a Detailed Comparative Analysis .....................................................................10-5 11. FORMATTING AND EDITING OUTPUT .....................................................................................11-1 11. 1 Formatting and Editing Tables ................................................................................................11-1 11. 1.A. Accessing the Window for Formatting / Editing Tables......................................................11-1 11. 1.B. Changing the Width of Columns .........................................................................................11-4 11. 1.C. Deleting Columns ................................................................................................................11-5 11. 1.D. Transposing .........................................................................................................................11-5 11. 1.E. Finding Appropriate Width and Height................................................................................11-6 11. 1.F. Deleting Specific Cells ........................................................................................................11-6 11. 1.G. Editing (Data or Text) in Specific Cells ..............................................................................11-7 www.vgupta.com
第 14 页
Table of Contents Table of Contents- 9 11. 1.H. Changing the Font ...............................................................................................................11-8 11. 1.I. Inserting Footnotes ..............................................................................................................11-8 11. 1.J. Picking from Pre-set Table Formatting Styles.....................................................................11-9 11. 1.K. Changing Specific Style Properties ...................................................................................11-10 11. 1.L. Changing the Shading of Cells ..........................................................................................11-11 11. 1.M Changing the Data Format of Cells....................................................................................11-12 11. 1.N. Changing the Alignment of the Text or Data in Cells .......................................................11-14 11. 1.O. Formatting Footnotes.........................................................................................................11-15 11. 1.P. Changing Borders and Gridlines ........................................................................................11-16 11. 1.Q. Changing the Font of Specific Components (Data, Row Headers, etc.) ............................11-17 11. 2 Formatting and Editing Charts ..............................................................................................11-18 11. 2.A. Accessing the Window for Formatting / Editing Charts....................................................11-18 11. 2.B. Using the Mouse to Edit Text ............................................................................................11-21 11. 2.C. Changing a Chart from Bar Type to Area/Line Type (or Vice Versa)...............................11-22 11. 2.D. Making a Mixed Bar/Line/Area Chart...............................................................................11-23 11. 2.E. Converting into a Pie Chart................................................................................................11-24 11. 2.F. Using the Series Menu: Changing the Series that are Displayed.......................................11-25 11. 2.G. Changing the Patterns of Bars, Areas, and Slices ..............................................................11-27 11. 2.H. Changing the Color of Bars, Lines, Areas, etc...................................................................11-28 11. 2.I. Changing the Style and Width of Lines.............................................................................11-29 11. 2.J. Changing the Format of the Text in Labels, Titles, or Legends ........................................11-31 11. 2.K. Flipping the Axes...............................................................................................................11-31 11. 2.L. Borders and Frames ...........................................................................................................11-32 11. 2.M Titles and Subtitles.............................................................................................................11-33 11. 2.N. Footnotes ...........................................................................................................................11-33 11. 2.O. Legend Entries ...................................................................................................................11-35 11. 2.P. Axis Formatting..................................................................................................................11-37 11. 2.Q. Adding/Editing Axis Titles................................................................................................11-38 11. 2.R. Changing the Scale of the Axes.........................................................................................11-39 11. 2.S. Changing the Increments in which Values are Displayed on an Axis ................................11-39 11. 2.T. Gridlines ............................................................................................................................11-40 11. 2.U. Formatting the Labels Displayed on an Axis.....................................................................11-42 12. READING ASCII TEXT DATA....................................................................................................12-1 12. 1 Understanding ASCII Text Data..............................................................................................12-1 12. 1.A. Fixed-field/Fixed-column ....................................................................................................12-2 12. 1.B. Delimited/Freefield ..............................................................................................................12-2 12. 2 Reading Data Stored in ASCII Tab-delimited Format ..........................................................12-3 12. 3 Reading Data Stored in ASCII Delimited (Freefield) Format other than Tab.....................12-4 www.vgupta.com
第 15 页
Table of Contents Table of Contents- 10 12. 4 Reading Data Stored in Fixed Width (or Column) Format ...................................................12-6 13. MERGING: ADDING CASES & VARIABLES..............................................................................13-1 13. 1 Adding New Observations.........................................................................................................13-1 13. 2 Adding New Variables (Merging).............................................................................................13-4 13. 2.A. One-way Merging................................................................................................................13-7 13. 2.B. Comparing the Three Kinds of Merges: A Simple Example ...............................................13-8 14. NON-PARAMETRIC TESTING ...................................................................................................14-1 14. 1 Binomial Test .............................................................................................................................14-1 14. 2 Chi-square ..................................................................................................................................14-5 14. 3 The Runs Test - Checking Whether a Variable is Randomly Distributed..........................14-10 15. SETTING SYSTEM DEFAULTS...................................................................................................15-1 15. 1 General Settings .........................................................................................................................15-1 15. 2 Choosing the Default View of the Data and Screen ................................................................15-4 16. READING DATA FROM DATABASE FORMATS .........................................................................16-1 17. TIME SERIES ANALYSIS...........................................................................................................17-1 17. 1 Sequence Charts (Line Charts with Time on the X-Axis) ......................................................17-4 17. 1.A. Graphs of the "Level” (Original, Untransformed) Variables ...............................................17-4 17. 1.B. Graphs of Transformed Variables (Differenced, Logs) .......................................................17-8 17. 2 Formal Checking for Unit Roots / Non-stationarity .............................................................17-10 17. 2.A. Checking the “Level” (Original, Untransformed) Variables .............................................17-11 17. 2.B. The Removal of Non-stationarity Using Differencing and Taking of Logs.......................17-16 17. 3 Determining Lagged Effects of other Variables....................................................................17-21 www.vgupta.com
第 16 页
Table of Contents Table of Contents- 11 17. 4 Creating New Variables (Using Time Series-specific Formulae: Difference, Lag, etc.)..............................................................................................................................17-27 17. 4.A. Replacing Missing Values .................................................................................................17-30 17. 5 ARIMA .....................................................................................................................................17-30 17. 6 Correcting for First-order Autocorrelation Among Residuals ...........................................17-35 17. 7 Co-integration ..........................................................................................................................17-38 18. PROGRAMMING WITHOUT PROGRAMMING (USING SYNTAX AND SCRIPTS)…….. .........................18-1 18.1 Using SPSS Scripts…. ...............................................................................................................18-1 18.2 Using SPSS Syntax….................................................................................................................18-4 18.1.a Benefits of using Syntax .....................................................................................................18-7 18.2.b Using Word (or WordPerfect) to save time in creating code................................................18-8 To take quizzes on topics within each chapter go to http://www.spss.org/wwwroot/spssquiz.asp www.vgupta.com
第 17 页
Introduction i Introduction Merits of the book This book is the only user-oriented book on SPSS: • It uses a series of pictures and simple instructions to teach each procedure. Users can conduct procedures by following the graphically illustrated examples. The book is designed for the novice - even those who are inexperienced with SPSS, statistics, or computers. Though its content leans toward econometric analysis, the book can be used by those in varied fields, such as market research, criminology, public policy, management, business administration, nursing, medicine, psychology, sociology, anthropology, etc. • Each method is taught in a step-by-step manner. • An analytical thread is followed throughout the book - the goal of this method is to show users how to combine different procedures to maximize the benefits of using SPSS. • To ensure simplicity, the book does not get into the details of statistical procedures. Nor does it use mathematical notation or lengthy discussions. Though it does not qualify as a substitute for a statistics text, users may find that the book contains most of the statistics concepts they will need to use. Organization of the Chapters The chapters progress naturally, following the order that one would expect to find in a typical statistics project. Chapter 1, “Data Handling," teaches the user how to work with data in SPSS. It teaches how to insert data into SPSS, define missing values, label variables, sort data, filter the file (work on sub-sets of the file) and other data steps. Some advanced data procedures, such as reading ASCII text files and merging files, are covered at the end of the book (chapters 12 and 13). Chapter 2, “Creating New Variables,” shows the user how to create new categorical and continuous variables. The new variables are created from transformations applied to the existing variables in the data file and by using standard mathematical, statistical, and logical operators and functions on these variables. Chapter 3, “Univariate Analysis,” highlights an often-overlooked step - comprehensive analysis of each variable. www.vgupta.com
第 18 页
Introduction ii Several procedures are addressed - included among these are obtaining information on the distribution of each variable using histograms, Q-Q and P-P plots, descriptives, frequency analysis, and boxplots. The chapter also looks at other univariate analysis procedures, including testing for means, using the T-Test and error bars, and depicting univariate attributes using several types of graphs (bar, line, area, and pie). Chapter 4, “Comparing Variables,” explains how to compare two or more similar variables. The methods used include comparison of means and graphical evaluations. Chapter 5, “Patterns Across Variables (Multivariate Statistics),” shows how to conduct basic analysis of patterns across variables. The procedures taught include bivariate and partial correlations, scatter plots, and the use of stem and leaf graphs, boxplots, extreme value tables, and bar/line/area graphs. Chapter 6, “Custom Tables,” explains how to explore the details of the data using custom tables of statistics and frequencies. In Chapter 7, “Linear Regression,” users will learn linear regression analysis (OLS). This includes checking for the breakdown of classical assumptions and the implications of each breakdown (heteroskedasticity, mis-specification, measurement errors, collinearity, etc.) in the interpretation of the linear regression. A major drawback of SPSS is its inability to test directly for the breakdown of classical conditions. Each test must be performed step-by-step. For illustration, details are provided for conducting one such test - the White’s Test for heteroskedasticity. Chapter 8, “Correcting for the Breakdown of Classical Assumptions,” is a continuation of the analysis of regression from chapter 7. Chapter 8 provides examples of correcting for the breakdown of the classical assumptions. Procedures taught include WLS and Weight Estimation to correct for heteroskedasticity, creation of an index from several variables to correct for collinearity, 2SLS to correct for simultaneity bias, and model re-specification to correct for mis-specification. This is the most important chapter for econometricians because SPSS does not provide many features that automatically diagnose and correct for the breakdown of classical assumptions. Chapter 9, “Maximum Likelihood Estimation: Logit, and Non-Linear Estimation,” teaches non- linear estimation methods, including non-linear regression and the Logit. This chapter also suggests briefly how to interpret the output. Chapter 10 teaches "comparative analysis," a term not found in any SPSS, statistics, or econometrics textbook. In this context, this term means "analyzing and comparing the results of procedures by sub-samples of the data set." Using this method of analysis, regression and statistical analysis can be explained in greater detail. One can compare results across categories of certain variables, e.g. - gender, race, etc. In our experience, we have found such an analysis to be extremely useful. Moreover, the procedures taught in this chapter will enable users to work more efficiently. www.vgupta.com
第 19 页
Introduction iii Chapter 11, “Formatting Output,” teaches how to format output. This is a SPSS feature ignored by most users. Reviewers of reports will often equate good formatting with thorough analysis. It is therefore recommended that users learn how to properly format output. Chapters 1-11 form the sequence of most statistics projects. Usually, they will be sufficient for projects/classes of the typical user. Some users may need more advanced data handling and statistical procedures. Chapters 12-18 explore several of these procedures. The ordering of the chapters is based on the relative usage of these procedures in advanced statistical projects and econometric analysis. Chapter 12, “Reading ASCII Text Data,” and chapter 13 “Adding Data,”deal specifically with reading ASCII text files and merging files. The task of reading ASCII text data has become easier in SPSS 9.0 (as compared to all earlier versions). This text teaches the procedure from versions 7.x forward. Chapter 14, "Non-Parametric Testing," shows the use of some non-parametric methods. The exploration of various non-parametric methods, beyond the topic-specific methods included in chapters 3, 4, and 5, are discussed herein. Chapter 15, "Setting System Options," shows how to set some default settings. Users may wish to quickly browse through this brief section before reading Chapter 1. Chapter 16 shows how to read data from any ODBC source database application/format. SPSS 9.0 also has some more database-specific features. Such features are beyond the scope of this book and are therefore not included in this section that deals specifically with ODBC source databases. Chapter 17 shows time series analysis. The chapter includes a simple explanation of the non-stationarity problem and cointegration. It also shows how to correct for non-stationarity, determine the specifications for an ARIMA model, and conduct an ARIMA estimation. Correction for first-order autocorrelation is also demonstrated. Chapter 18 teaches how to use the two programming languages of SPSS )without having to do any code-writing yourself). The languages are: 1. Syntax -- for programming procedures and data manipulation 2. Script -- (mainly) for programming on output tables and charts Book 2 in this series ("SPSS for Beginners: Advanced Methods") will include chapters on hierarchical cluster analysis, discriminant analysis, factor analysis, optimal scaling, correspondence analysis, reliability analysis, multi-dimensional scaling, general log-linear models, advanced ANOVA and GLM techniques, survival analysis, advanced ranking, using www.vgupta.com
第 20 页
Introduction iv programming in SPSS syntax, distance (Euclidean and other) measurement, M-estimators, and Probit and seasonal aspects of time series. As these chapters are produced, they will be available for free download at www.spsss.org. This may be the first interactive book in academic history! Depending on your comments/feedback/requests, we will be making regular changes to the book and the free material on the web site. The table of contents is exhaustive. Refer to it to find topics of interest. The index is in two parts - part 1 is a menu-to-chapter (and section) mapping, whereas part 2 is a regular index. Conventions used in this book # All menu options are in all-caps. For example, the shortened version of: “Click on the menu1 "Statistics," choose the option "Regression," within that menu, choose the option "Linear regression," will read: “Go to STATISTICS / REGRESSION / LINEAR REGRESSION." # Quotation marks identify options in pictures. For example: Select the button “Clustered.” # Variable names are usually in italics. For example, gender, wage, and fam_id. Variable names are expanded sometimes within the text. For example, work_ex would read work experience. # Text and pictures are placed side-by-side. When a paragraph describes some text in a picture, the picture will typically be to the right of the paragraph. # Written instructions are linked to highlighted portions of the picture they describe. The highlighted portions are denoted either by a rectangle or ellipse around the relevant picture- component or by a thick arrow, which should prompt the user to click on the image. # Some terms the user will need to know: a dialog box is the box in any Windows® software program that opens up when a menu option is chosen. A menu option is the list of procedures that the user will find on the top of the computer screen. # Text that is shaded but not boxed is a note, reminder, or tip that digresses a bit from the main text. # Text that is shaded a darker gray and boxed highlights key features. Data set used in the example followed through this book One data set is used for most of the illustrations and examples in this book. This allows the user to use the book as a tutorial. Unfortunately, as of present, we cannot find an uncorrupted version of the data file (we had a virus problem). As and when we can obtain such a copy (from an ex-student hopefully) we will place it at http://www.spss.org/wwwroot/spssdown.asp. I created a data set that has the same variable names, sample size and coding as in the corrupted file. The "proxy" data file is provided in the zipped file you downloaded. (Your results will not match 1 A “menu” is a list of options available from the list on the top of the computer screen. Most software applications have these standard menus: FILE, EDIT, WINDOW, and HELP. www.vgupta.com
评论 (0)
暂无评论。快来抢沙发吧!