SPSS Tutorial A detailed Explanation (Hướng dẫn chi tiết SPSS trong xử lý dữ liệu và tạo biểu đồ thống kê) (Tiếng Anh)

UN
Uni24h
0 次下载
193
0

资料内容

第 1 页

i Table of Contents Getting Started with SPSS............................................................................................................................1 ►Opening SPSS........................................................................................................................................ 1 ►Using SPSS Files ................................................................................................................................... 3 ►Entering Data into the Data View.......................................................................................................... 5 ►Working with data ................................................................................................................................. 5 ►Computations with data ......................................................................................................................... 7 ►Opening Saved Data Sheets................................................................................................................. 10 ►Importing Data from Excel .................................................................................................................. 12 ►Importing Data from ASCII................................................................................................................. 15 ►Using the Output Viewer ..................................................................................................................... 18 Chapter 1. Data Collection........................................................................................................................20 Section 1.1 Introduction to the Practice of Statistics............................................................................... 20 Section 1.2 Observational Studies, Experiments, and Simple Random Sampling .................................. 20 ►Obtaining a Simple Random Sample from a list............................................................................. 20 ►Obtaining a Simple Random Sample without a list in SPSS........................................................... 23 Section 1.3 Other Effective Types of Sampling ...................................................................................... 26 Chapter 2. Organizing and Summarizing Data.......................................................................................27 Section 2.1 Organizing Qualitative Data................................................................................................. 27 ►Creating a Frequency Distribution .................................................................................................. 27 ►Creating a Frequency and Relative Frequency Bar Graph.............................................................. 28 ►Creating a Side-by-Side Frequency Bar Graph............................................................................... 32 ►Creating a Pie Chart ........................................................................................................................ 36 Section 2.2 Organizing Quantitative Data: The Popular Displays .......................................................... 40 ►Creating a Histogram ...................................................................................................................... 40 ►Creating a Stem-and-Leaf Plot........................................................................................................ 44 ►Creating a Dot Plot.......................................................................................................................... 46 ►Creating a Back-to-Back Histogram ............................................................................................... 47 Section 2.3 Additional Displays of Quantitative Data............................................................................. 51 ►Creating a Frequency Polygon ........................................................................................................ 51 ►Creating a Time Series Plot ............................................................................................................ 53 Chapter 3. Numerically Summarizing Data ............................................................................................56 ►Finding the basics: mean, standard deviation, percentiles, etc........................................................ 56 ►Finding measures based on Grouped data....................................................................................... 60 ►Finding a z-score............................................................................................................................. 62 ►Creating a box-plot.......................................................................................................................... 63 Chapter 4. Describing the Relation between Two Variables..................................................................67 Section 4.1 Scatter Diagrams and Correlation......................................................................................... 67 ►Creating a Scatter diagram.............................................................................................................. 67 ►Finding Correlation ......................................................................................................................... 68 Section 4.2 Least Squares Regression ..................................................................................................... 69 ►Fitting a line in a Scatter diagram ................................................................................................... 69 ►Finding the Least-Squares Regression Equation............................................................................. 71 Section 4.3 Diagnostics on the Least-Squares Regression Line.............................................................. 73 ►Coefficient of Determination .......................................................................................................... 73 ►Producing a Residual Plot ............................................................................................................... 73 Section 4.4 Nonlinear Regression: Transformations (on CD)................................................................. 75 ►Non-linear transformations ............................................................................................................. 75 Chapter 5. Probability ...............................................................................................................................78 Section 5.1 Probability Rules .................................................................................................................. 78 ►Simulating Probabilities.................................................................................................................. 78 Chapter 6. Discrete Probability Distributions.........................................................................................83 Section 6.1 Expected Values ................................................................................................................... 83

第 2 页

ii Section 6.2 The Binomial Probability Distribution ................................................................................. 83 ►Binomial Distribution ..................................................................................................................... 83 Section 6.3 The Poisson Probability Distribution ................................................................................... 86 ►Poisson Distribution........................................................................................................................ 86 Chapter 7. The Normal Probability Distribution....................................................................................90 Section 7.1 Properties of the Normal Distribution .................................................................................. 90 ►Uniform Distribution....................................................................................................................... 90 ►Adding a Normal Curve to a Histogram ......................................................................................... 92 Section 7.2 The Standard Normal Distribution ....................................................................................... 94 ►Finding the Area under the Standard Normal Curve....................................................................... 94 Section 7.3 Applications of the Normal Distribution .............................................................................. 94 ►Finding the Area under a Normal Curve......................................................................................... 94 ►Finding Values of Normal Random Variables ................................................................................ 97 Section 7.4 Assessing Normality............................................................................................................. 99 ►Creating a Normal Probability or Q-Q Plot .................................................................................... 99 Section 7.5 The Normal Approximation to the Binomial Probability Distribution............................... 101 ►Normal Approximation to the Binomial ....................................................................................... 101 Chapter 8. Sampling Distributions.........................................................................................................102 Section 8.1 Distribution of the Sample Mean........................................................................................ 102 ►Sampling Distribution Simulation - Mean .................................................................................... 102 ►Applying the Central Limit Theorem............................................................................................ 105 Section 8.2 Distribution of the Sample Proportion................................................................................ 106 ►Sampling Distribution Simulation - Proportion ............................................................................ 106 Chapter 9. Estimating the Value of a Parameter ..................................................................................109 Section 9.1 The Logic in Constructing Confidence Intervals about a Population Mean....................... 109 ►Constructing 20 95% Confidence Intervals Based on 20 Samples ............................................... 109 Section 9.2 Confidence Intervals about a Population in Practice .......................................................... 111 ►Finding t-values ............................................................................................................................ 111 ►Constructing Confidence Intervals when σ is unknown................................................................ 112 Section 9.3 Confidence Intervals about a Population Proportion.......................................................... 113 ►Constructing Confidence Intervals about a Population Proportion ............................................... 113 Section 9.4 Confidence Intervals about a Population Standard Deviation ............................................ 115 ►Finding Critical values for the Chi-Square Distribution ............................................................... 115 ►Constructing Confidence Intervals about a Population Standard Deviation ................................. 116 Chapter 10. Testing Claims Regarding a Parameter............................................................................119 Section 10.2 A Model for Testing Claims about a Population Mean .................................................... 119 ►Testing a hypothesis about μ, σ known......................................................................................... 119 Section 10.3 Testing Claims about a Population Mean in Practice ....................................................... 122 ►Testing a hypothesis about μ, σ unknown..................................................................................... 122 Section 10.4 Testing Claims about a Population Proportion ................................................................. 124 ►Testing a Hypothesis about a Population Proportion .................................................................... 124 Section 10.5 Testing a Claim about a Population Standard Deviation .................................................. 127 ►Testing a Hypothesis about σ........................................................................................................ 127 Section 10.7 The Probability of a Type II Error and the Power of the Test .......................................... 129 ►The probability of a type II error of the test.................................................................................. 129 Chapter 11. Inferences on Two Samples................................................................................................131 Section 11.1 Inference about Two Means: Dependent Samples ........................................................... 131 ►Inferences about Two Means: Dependent Samples ...................................................................... 131 Section 11.2 Inference about Two Means: Independent Samples ......................................................... 134 ►Inferences about Two Means: Independent Samples .................................................................... 134 Section 11.3 Inference about Two Population Proportions ................................................................... 138 ►Inferences about Two Population Proportions .............................................................................. 138 Section 11.4 Inference about Two Population Standard Deviations ..................................................... 142 ► Finding Critical Values for the F-Distribution............................................................................. 142

第 3 页

iii ►Inferences about Two Population Standard Deviations ................................................................ 143 Chapter 12. Inference on Categorical Data ...........................................................................................147 Section 12.1 Goodness of Fit Test......................................................................................................... 147 ►Goodness-of-Fit ............................................................................................................................ 147 Section 12.3 Tests for Independence and Homogeneity of Proportions................................................ 149 ►Contingency Tables and Independence Tests ............................................................................... 149 Chapter 13. Comparing Three or More Means.....................................................................................153 Section 13.1 Comparing Three or More Means (One-way Analysis of Variance)................................ 153 ►One-Way Analysis of Variance .................................................................................................... 153 Section 13.2 Post-Hoc Tests on One-Way Analysis of Variance.......................................................... 156 ►Performing Post-Hoc Tests ........................................................................................................... 156 Section 13.3 The Randomized Complete Block Design ....................................................................... 158 ►Performing an ANOVA for random block designs....................................................................... 158 Section 13.4 Two-way Analysis of Variance ........................................................................................ 162 ►Performing a two-way ANOVA ................................................................................................... 162 Chapter 14. Inference on the Least-Squares Regression Model and Multiple Regression................166 Section 14.1 Testing the Significance of the Least-Squares Regression Model.................................... 166 ►Testing the Least-Squares Regression Model ............................................................................... 166 Section 14.2 Confidence and Prediction Intervals................................................................................. 169 ►Creating Confidence and Prediction Intervals............................................................................... 169 Section 14.3 Multiple Linear Regression .............................................................................................. 172 ►Obtaining the Correlation Matrix.................................................................................................. 172 ►Obtaining the Multiple Regression Equation ................................................................................ 173 ►Obtaining the Residual Plots......................................................................................................... 174 ►Creating Confidence and Prediction Intervals............................................................................... 178 Chapter 15. Nonparametric Statistics ....................................................................................................180 Section 15.2 Runs Test for Randomness ............................................................................................... 180 ►Runs Test for Randomness ........................................................................................................... 180 Section 15.3 Inferences about Measures of Central Tendency.............................................................. 183 ►One-Sample Sign Test .................................................................................................................. 183 Section 15.4 Inferences about the Difference between Two Measures of Central Tendency: Dependent Samples.................................................................................................................................................. 184 ►Wilcoxon Matched-Pairs Signed Rank Test ................................................................................. 184 Section 15.5 Inferences about the Difference between Two Measures of Central Tendency: Independent Samples.................................................................................................................................................. 186 ►Mann-Whitney Test ...................................................................................................................... 186 Section 15.6 Spearman’s Rank-Correlation Test................................................................................... 188 ►Spearman’s Rank-Correlation Test ............................................................................................... 188 Section 15.7 Kruskal-Wallis Test of One-Way Analysis of Variance................................................... 189 ►Kruskal-Wallis One-Way Analysis of Variance Test ................................................................... 189

第 4 页

Getting Started with SPSS 1 Getting Started with SPSS ►Opening SPSS When you first open SPSS, the first screen you should see is the “What would you like to do?” window. This is asking for how you would like to enter the data. The first option, Run the tutorial will take you to a SPSS tutorial. This is a nice little guide on the basics of SPSS. It will walk you through entering data, doing basic analysis, and working with SPSS output. It also gives an introduction to using the SPSS help function. The next option is to Type in Data. If you have data from a book, or your own research, or some other place that is not currently on the computer, this is the option you would want to choose.

第 5 页

Getting Started with SPSS 2 Run an Existing Query will help you bring data in from another database, which you have used before. When you run a query into an Excel sheet, or another type of database, you can save the commands so that you don’t have to start from scratch each time you want to read in the information. This is very useful when you are doing the same type of analysis over and over again on data that gets updated regularly. Create a new query using Database Wizard walks you step by step in reading in data that exists on the computer in a non-SPSS format. These formats include dBase Files, Excel Files, MS Access Databases, and any other database that you have a database (ODBC) driver for. These can be added through the Add Data Source button. This is an easy way to change from Excel format into SPSS. Open an existing data source, which is an SPSS data set. The recently used data sets will appear in the box for easy access to the data sets you were last utilizing. Open another type of file will allow you to open SPSS scripts, which can be useful for randomly created data sets, or for specific programs you have saved. All of these options are available in SPSS through the file menu, and you can ask to not see this menu by clicking the Do not show this dialog in the future box. This would take you directly into SPSS on future executions.

第 6 页

Getting Started with SPSS 3 ►Using SPSS Files SPSS begins with two views, the Data View, and the Variable View. Data View is the default start window, and looks like a spreadsheet. Each column is a variable, and each row is an observation. SPSS is set up to accept survey data, and so it expects data for every row for each column with data.

第 7 页

Getting Started with SPSS 4 The Variable View window is accessed by clicking on the Variable View tab at the bottom of the Data View window. This is where you can add or change variable names, types, how they are viewed, etc. Name is the name of the variable. It cannot be more than 64 characters long, must start with a letter, and cannot use any other symbols than a period, @, #, _, and $. No spaces are allowed, and the name cannot end in a period. While this may seem constricting, this is just a variable name. Labels can be used to give better detail on what is contained in the variable. Spaces are allowed in labels, but labels cannot be longer than 256 characters long. The Type of variable can be selected from Numeric (example: 10000.001), Comma (example: 10,000.001), Dot (European convention, example: 10.000,001), Scientific Notation (example: 1.00E+004), Date (example: 01-June-2005), Dollar (example: $10,000), Custom Currency, and string (text, example: Male) . Width is the width of the variable (how many characters). This is most useful when changing String, but can be used for long numbers as well. The Decimals column gives how many decimal places to show. This does not change the values, just how they are seen in the Data View sheet. Values allow you to give labels to specific values, such as 0-male 1-female. To view the label instead of the number, go to View, and check the Value Labels. Missing allows you to specify what characters, numbers, etc. denote a missing value. Columns dictate how wide the column in the Data View sheet will be. Align allows you to adjust the alignment of the values in the Data View Sheet (Right, Left, Center). Measure is what type of variable you have. The choices are: Nominal (used for string, but can be used for numbers where the numbers just represent names), Ordinal (where order counts, but distance either varies or cannot be measured), and Scale (the normal numerical line). The type of analysis possible depends on which you chose.

第 8 页

Getting Started with SPSS 5 ►Entering Data into the Data View Although it is not necessary to define the variables before typing in data, it is suggested to do so. Define the variables in the Variable View window, providing at least a name, and what Type of variable you wish to use. If you define a variable to be numerical, only numbers will be allowed in that column. If you define a variable to be a string, then you can type any text into the cells, provided they do not go past the length defined. If you begin by typing in a cell in the Data View window instead, an automatic name will be created (usually VAR0001 if it is the first variable) and what you type will determine the type of variable. Putting in any numerical value will define the variable as numerical, and no value in that column will be accepted which is non-numerical. If you start by typing in text, the variable will be defined as a string, and the length will be set to be the length of the text you type in. (Example: Typing FOX into the first cell will define the variable to be a string, with a width of 3 characters. Typing in GOOSE into the next cell will give you GOO, as only 3 characters will be allowed). These definitions can still be changed in the Variable View window. ►Working with data Before entering in data values, it is best to consider what type of variables you are looking at, and what type of analysis you want to run on the data. There are three major types of data to worry about. -Nominal data: nominal data have no ordering issues, and can easily be entered as seen. For regression, or higher analysis, dummy variables should be used, but these can be created later. -Ordinal data: ordinal data have a natural ordering to it, and so, the ordering needs to be preserved. This can be accomplished by using numbers to represent the data, in order, and then attaching labels for the numbers. For example, a survey asks “What year of school are you in?” with responses ranging from high school to graduate school. In SPSS, we create a new variable, schoolyear, which will be numeric, no decimals, and a Measure of ordinal. This is all done in the Variable View page. Clicking on the Values box will show a … button, and clicking on the … button will open the Value Labels dialog window.

第 9 页

Getting Started with SPSS 6 In the Value Labels dialog window, the first box is the Value of the variable, as you will be typing it into SPSS. We will use 1 for high school, so we type a 1 in the Value box, and High School in the Value Label box. Once values are in both boxes, the Add button is available. Press Add, and any 1 in the column will be recognized by SPSS as High School. Once you add in all the possible values, push OK. If a value needs to be changed, you can highlight the value, which will put the information back into the Value and Value Label boxes, make the appropriate changes, and push the Change button. You can remove labels by highlighting them, and pressing the Remove button. When labels are being used, you will see text in the Labels box, starting with the first value. We can then switch to the Data View sheet, and enter in the information.

第 10 页

Getting Started with SPSS 7 You will see the values as the numbers that you enter, but you can change that, by going to the View menu, and checking the Value Labels option. This will let you see the labels instead of the actual values. You will still type in a 1, 2, etc. but you will see the full names. This is also useful for any nominal values that you don’t want to have to type multiple times. It is much easier to type in small numbers than long strings. Although the analysis uses the numbers, thus preserving order, the output will print the labels. -Numerical data: Numbers can be typed in directly, but be aware that you may not see the full number. You can change the number of characters shown in the Variable View sheet, as well as the number of decimal places shown. Reducing the number of decimal places does not change the value of the number. SPSS does not round the actual value, only the value that you see. ►Computations with data There are times when you will want to perform some type of calculation using your data, such as squaring values, or finding probabilities, or creating a new variable with random values. SPSS has a calculator for such transformations. When you go to Transform → Compute you can make many types of changes to your data. This will open up the Compute Variable window. You must already have data before this will open. The Compute Variable window contains five main boxes. The first is the Target Variable. This is a name for

第 11 页

Getting Started with SPSS 8 the new variable which you are creating. You can overwrite an existing variable if you so desire, but SPSS will give a warning before allowing you to do so. The window below the Target Variable is a list of the current variables. All of these can be used as part of the function, and the list lets you come up with a name that will be different from what already exists. The Numeric Expression box is where you will put in the function you want to use. This could be as simple as 1+1, which would create a new variable, with the same number of rows as the existing data, all with the value of 2. The next box is the Function group box. This is the general category for mathematical or statistical functions that are available to use. For example, highlighting Arithmetic brings up a list of arithmetic operators in the Functions and Special Variables box. So, to calculate absolute values, we will highlight Abs in the list of Functions and Special Values, and an explanation of the function will appear in the box next to the function list.

第 12 页

Getting Started with SPSS 9 To use the Abs function, we will need a numerical expression to put into the parentheses. This value could be any of the variables or a function of the variables. So, we could use ABS(totval-landval) to get a new variable which is the absolute difference between total appraised value and appraised land value. Another way to change the data is to recode the information. To recode, go to Transform → Recode, and select Into Same Variables… which overwrites an existing variable, or Into Different Variables… which creates a new variable. It is generally preferred to create a new variable in case of mistakes unless memory becomes a problem. Selecting the different variables option will open up a Recode into Different Variables window. You select which variable you want to recode, and a name for the new variable. To create the variable, you must push the change button, which takes the new name to the right of the → in the Numeric Variable → Output Variable box. Once you have a name for the variable, click on Old and New Values. This will open the Recode into Different Variables: Old and New Values window. This is where you tell SPSS what changes you would like to make to the data.

第 13 页

Getting Started with SPSS 10 In the Old Value list, you let SPSS know what the old value was. If you have a short list, you can use the Value box. Type in the old value, put the new value in the New value box, and click Add. This is useful when you want to switch order, for example, you receive data that has a 5 point scale, where 1 is high and 5 is low, and you want 5 to be high and 1 to be low. You can then put 1 for the old value, and 5 for the new value, etc. If you have a list of numbers, you can use the Range values. This can be used to categorize numerical data, for example heights from height in inches to short, medium, tall. Once you have completed the full list, push the Continue button, and then you can push OK. You will now have a new, recoded variable. The Old and New Values works similarly for recoding into the same variable, but you don’t have a window in which to name the variable. ►Opening Saved Data Sheets To open a saved SPSS data sheet, click on File → Open → Data … The following screen will appear.

第 14 页

Getting Started with SPSS 11 First, you must find where your data files are stored. The default location for SPSS to begin looking is in the data sets that came with the program. You can change the disk location by using the Look in: box. It is best to keep all of your data sets in a location that is easy to find. SPSS data sets will appear as little blue data boxes with SPSS in red above them. They also have the extension .sav following the name. No other data type can be read in as an SPSS data set.

第 15 页

Getting Started with SPSS 12 ►Importing Data from Excel As most of the data come in three formats on the disk supplied with ASCII files, Excel files, and MINITAB files, but not SPSS files, it will be advantageous to import from one of these formats rather than recreating the data sets. You will need to save the files from the disk onto your hard drive, as they are not accessible by browsing the CD. Excel files are easier to import from than ASCII, as they follow specific conventions. To import from an excel file, go to File → Open Database → New Query … This will open up a Database Wizard window. Highlight Excel Files, and push the Next> button. This will give you a dialog window. Use the Browse… button to find the file that you wish to open. The Excel file cannot be open in Excel when importing the data, as a sharing violation will occur.

第 16 页

Getting Started with SPSS 13 The next screen is the Select Data screen. You may select all of a data set, or portions of the file. If Excel has more than one sheet available, this is also where you would specify which sheet contains the data that you want to use. Drag the sheet over from the Available Tables box to the Retrieve Fields in This Order box. When you click on the available table, a hand will appear. Keep the mouse button pressed until the hand is over the Retrieve box. This will give a list of the variables in the data set. You may change the order of the variables, or remove variables at this point. When you are ready, push Next> or Finish.

第 17 页

Getting Started with SPSS 14 Pushing Next> will take you to a window where you can limit the number of observations to bring in, including the possibility of bringing in a random sample of the observations. Pushing Next> again will take you to the Define Variables window. Here you can change the variable type, or length. Pushing Next> again will take you to the Results window. Here you have the option of saving the query that you just ran. This is useful if you plan on opening the same Excel file many times. It is easier to save the data as an SPSS file than to re-import the data over and over again, but in business practice, there are times when you will want to open the same file numerous times, after updating the information in the file. When there are a large number of observations available in the data set, it is easier to save the query and just re-run it periodically than to re-make the query each time.

第 18 页

Getting Started with SPSS 15 Pushing the Finish button at any time will bring the data into SPSS. The name of the column will be obtained from the first row in Excel, but will be changed to accommodate the SPSS naming conventions. ►Importing Data from ASCII There are times when importing from an ASCII (text) file is necessary, especially when retrieving data from web sites. To read in a text file, go to File → Read Text Data… This will take you to an Open File window, where you will browse for the file that you want to import the data from.

第 19 页

Getting Started with SPSS 16 Once you select which file you want to use, the text import wizard will open. The first step is to see if the data is the correct one, you will see the first couple lines of the file in the bottom box. If you are going to read in the same document over and over, you can save the format, and use that in the predefined format box. Step 2 is to tell SPSS how the data looks. If you are using a file which is Delimited (using the same character to distinguish between variables) then use the Delimited button. If the variables are EXACTLY

第 20 页

Getting Started with SPSS 17 in line, you can use the Fixed width button. Files can be delimited with a space, but this means that spaces cannot be inside strings. If the data is not exactly lined up, the fixed width will not work very well. Also, define whether the first row is the variable name, or part of the data. Step 3 is either to tell SPSS where the data starts. If the data starts on any row other than the second, you can change that information here as well. If you don’t want to read in the whole data set, you can limit the number of cases. Step 4 is to define the delimiter or to define the widths. SPSS tries to define a delimiter based on general conventions, but these can be changed. The common delimiters are listed (Tab, Space, etc.) but a box is available for different delimiters. With the fixed width, you will put in a line delineating the variables.

显示前 20 页。下载资料查看完整内容。

评论 (0)

登录 以加入讨论

暂无评论。快来抢沙发吧!