DEPARTMENT OF HEALTH AND HUMAN SCIENCES HS900 RESEARCH METHODS Using SPSS Topics addressed today: 1. Accessing data from CMR 2. Starting SPSS 3. Getting familiar with SPSS 4. Entering data 5. Saving data files 6. Opening existing data 7. Producing descriptive statistics SPSS Software The University s licence allows students to have a copy of SPSS for their home use. A copy of the software and licence details will be distributed in class. Installation instructions and the licence number you will need to complete installation. Instructions are also at: http://www2.essex.ac.uk/cs/documentation/installing/cshd-spss115inst.htm Accessing data from CMR Go to http://courses.essex.ac.uk/hs/hs900/ Browse to the Stream 1 page and then click on the SPSS link Right click on the data/document you want Choose Save target as Download data and/or document to your M (or A) drive. Download the data2.sav file. Starting SPSS You can launch SPSS from an icon on your desktop by double clicking on it. You can also start SPSS by clicking on START, moving your cursor up to Programs, and then moving it across to the list of programs available, and selecting SPSS for Windows Getting familiar with SPSS When you launch SPSS, you are presented with the SPSS opening screen. From here you can either enter your own data or open an existing data file. Notice that there are currently two window views: Data view and Variable view. The Data view window displays the contents of your data file, it is this window that you use to open, save, and close existing data files; create a new data file; enter data; and make changes to the existing data file. If you want to make any changes to your data file, or to save it, then you must have this window open and on the screen in front of you. In the Variable view window you can check the SPSS options that govern the way your data and output are displayed. The options allow you to define how your variables will be displayed, the size of your charts, the types of tables that will be displayed in the output, and many other aspects of the program. 1
How to change the output settings If you want to change the settings, do so before producing any output as the changes will close any previously open output. Here we will just focus on how our output is labelled. We want as much detail as possible in the labelling of variables in the output we will produce, so we tell SPSS to display the names and labels of variables: Select edit, options, change the variable lists box to display names Select the output labels tab and change the options to names and labels or values and labels Select draft viewer tab and click display commands in log Entering data From the start up screen choose Type in data Note the two tabs at the bottom left of the screen Data view and Variable view Choose Variable view In the box under name, type sex Under label, type sex of respondent Click in the box under values and define 1 as male and 2 as female Change measures to nominal Enter the details for two more variables: variable smoker; label respondent smokes; values 1 = yes and 2 = no; measures? variable age; label respondent age; measures? Click on the Data view tab and enter the following data: sex smoker age 1 1 23 2 2 45 2 1 32 1 2 54 2 1 34 1 2 65 2 1 76 1 2 44 2 2 43 2 2 19 2 1 21 1 2 22 2 2 56 1 2 78 2 2 54 1 1 54 2 2 32 1 1 18 2 2 23 1 1 26 2
Saving data files Open the File pull-down menu Click on Save as Enter the filename as data1 (note the.sav extension for SPSS data files) Choose your M drive Click OK Getting familiar with the data In the Data view window you can check the description of the variables. Click on the icon button with the?, and you will bring up a screen with the variable names on the left and information on each variable on the right. Scroll down the variable names until you find a variable name which interests you. Click on this variable, and you will see a description of the variable in the box on the right labelled: variable information. Again in the Data view window, click on the white label with the red line at the bottom icon (the icon that looks like a luggage tag). Click on this icon again. You will notice the data display screen switch between showing numbers and value labels. Checking for errors. When checking for errors, you are primarily looking for values that fall outside the range of possible values for a variable. To check for errors, you need to inspect the frequencies for each of your variables. There are a number of different ways for checking for errors in SPSS. The two main approaches are divisible into whether they are more suitable for categorical variables (e.g. variables with yes/no answers) or for continuous variables (e.g. age). The reason for the difference in the approaches is that some statistics are not appropriate for categorical variables (e.g. it is not appropriate to select mean for a variable with only two values); and in many cases with continuous variables, you would not want to see a list of all the possible values that the variable can take on. Descriptive statistics Descriptive statistics have a number of uses. They include: To describe the characteristics of your sample in the Methods section of your report; To check your variables for any violations of the assumptions underlying the statistical techniques that you will use to address your research questions; To address specific research questions. To obtain descriptive statistics for nominal or ordinal level variables, you should use frequency distributions. This will tell you how many people gave each response. It doesn t make sense asking for means, standard deviations etc for nominal level variables such as sex and marital status. In either the Data view or Variable view window, choose the pull down menu Analyze Descriptive Statistics Frequencies You will see a window named Frequencies with the variables in your data listed on the left. Click on sex to highlight it and then click on the right pointing arrow and sex will be displayed in the box Variable(s). This way of selecting variables of interest is similar to many other procedures you will use in SPSS. Click OK. 3
A new window called Output will automatically open and, depending on your output settings, you should see something like: Frequencies Statistics sex of respondent N Valid Missing 20 0 Valid male female Total sex of respondent Cumulative Frequency Percent Valid Percent Percent 9 45.0 45.0 45.0 11 55.0 55.0 100.0 20 100.0 100.0 Now produce the frequency table for the variable smoker. For interval level variables such as age, it might be easier to use summary statistics such as the mean and standard deviation. You might also be interested in the standard error of the mean, range, skewness and kurtosis of your variables, and they can be obtained by selecting these as options. Again, in either the Data view or Variable view window, choose the pull down menu Analyze Descriptive Statistics Descriptives (Note that once an Output window is open you can also access the Analyze pull down menu in that window.) In a similar way to the Frequencies procedure, you will see a window named Descriptives with the variables in your data listed on the left. Click on age to highlight it and then click on the right pointing arrow and sex will be displayed in the box Variable(s). Click OK. This output will be appended to your previous output in the Output window that is already open and should look something like: Descriptives Descriptive Statistics age of respondent Valid N (listwise) N Minimum Maximum Mean Std. Deviation 20 18.00 78.00 40.9500 18.90273 20 The output window The Output screen consists of two parts. On the left is an outline or menu pane, which gives you a full list of all the analyses you have conducted. You can use this side to quickly navigate you way around your output (which can become very long, very quickly). Just click on the section you want to move to and it will appear on the right-hand side of the screen. On the right-hand side of the window are the results of your analyses, which can include tables, charts and graphs. In this window, you can modify the output, delete it, copy it, save it, or 4
even transfer it into a Word document. When you save the output, it is saved in a separate file with a.spo extension to distinguish it from the data files, which have a.sav extension. Opening existing data From the start up window choose Open an existing data source. Recently used files are listed in the window below or choose OK and browse to where the data file is located. Alternatively, you can cancel this window and click the on the pull-down menu File New Data, or click on the folder icon on the SPSS toolbar. There are many ways to open data and they all work equally as well. In-class exercise 1. Open the data2.sav file in SPSS 2. Assess the data using the Variable view window check all characteristics of the variables. Anything wrong? 3. How many cases in the data? 4. How many nominal level variables? 5. How many ordinal level variables? 6. How many interval level variables? 7. How many men in the sample? 8. How many in the sample are married? 9. What percent of the sample are registered disabled? 10. What is the mean GHQ score? 5