Data can be entered directly into SPSS for analysis. In this assignment you will enter data from surveys into SPSS.
Resources Needed: To complete this assignment you need to obtain one blank survey and two completed surveys from the professor.
Create a Codebook: Your first task is to create a codebook representing the data that you will enter into SPSS. First, create a variable name for each data item in the "Background Information" section (questions 1-18) of the blank survey you were given. Variable names should be one word and should be kept relatively short, preferably 8 characters or less. However, they should also be reasonably descriptive of the data they represent. Write the variable names on the blank survey next to the data they represent. Keep in mind, some questions may require the creation of more than one variable. Question 18, for example, will require the creation of 12 variable names, one for each blank. Next, write the numeric codes that you will use to represent the attributes of each variable in the blanks beside the attributes. (Attributes are simply the different values a variable can have.) Remember, not all variables will require numeric codes, such as variables whose data are already numerical (age, for example) or long textual responses to open-ended questions. Finally, in the right margin, write a numeric code that you will use to represent missing data. Below is an example of what question 1 might look like once you finished.
|sex||1. What is your sex?||_1_ Male||_2_ Female||9=Missing|
Notice I have given the data represented by question 1 the variable name "sex" and have written the name in the left hand margin of the survey beside question 1. I have also indicated that I will use the number 1 to represent males, the number 2 to represent females, and the number 9 will be used to indicate missing data. Follow this format for every question in the "Background Information" section of the survey.
Now, create a codebook using the information from the survey you have marked. Click here to download an Excel spreadsheet to use as a guide. Save the spreadsheet to a floppy disk, memory stick, CD then open it using MS Excel. In the spreadsheet enter the variable name, question number, variable label (a brief description of the variable), variable type (numeric, text, date, etc.), values and value labels (numeric codes and the attributes they represent), and the level of measurement (nominal, ordinal, interval). I have done the first two variables as an example. After you have entered this information for every item in the "Background Information" section of the survey, print a copy of the codebook and save it to disk, memory stick, or CD.
Defining a Data Set in SPSS: Now, open SPSS by clicking on the SPSS icon on the computer's desktop. If the "What would you like to do?" window opens, close it by clicking on the "X" in the upper right hand corner or the "Cancel" button near the bottom of the window. If SPSS it is not already maximized so that it takes up the entire computer screen, maximize it by clicking on the box-like icon next to the "X" in the upper right-hand corner of the SPSS window. What you should see now is a spreadsheet-like application with numbered rows and columns labeled "var." Down near the bottom left-hand corner you should see two tabs, one labeled "Data View" and one labeled "Variable View." Click on "Variable View." Notice that columns are now labeled "Name," "Type," "Width," etc. The cell under "Name" in row 1 should be selected, if not click on it. Using the codebook you created as a guide, type the name of the first variable in the first cell in row 1. Using the example above, I would type "sex." Next, hit the Tab key. The second cell in row 1 under the label "Type" is now selected and the word "Numeric" is displayed. Since the data we will enter for this variable will be numeric (1 for males, 2 for females), we can leave it as it is. However, had the data been a string of text or a date, we would have had to click the icon with three dots and selected the appropriate type. For future reference, SPSS uses term "string" to indicate text data containing letters or spaces. Now hit the Tab key and the third cell in row 1 under the label "Width" is selected and an "8" is displayed. The data for the variable "sex" will never require more than one character (it will either be a 1, 2, or 9) and it will never contain decimal values, so we can set the width to 1 and the number of decimal places needed to 0. However, you will need to change the decimals value first since SPSS will not let you set the width value to less than the decimals value. You can change the 2 to 0 by either double-clicking the cell under the heading "Decimals" and typing "0" or by selecting the cell then clicking on the down pointing triangle until 0 is displayed. Follow the same procedure to change the "Width" to 1. Now click on the cell in row 1 under "Label" and type a descriptive label for the variable. I recommend keeping labels to 20 characters or less if possible, but they should accurately describe the variable. For example, for the question above, we might type "Sex of Respondent." Next, hit the Tab key or click on the cell under the heading "Values." Click on the small icon containing three dots. In the window that appears, type "1" beside the word "Value" and "Male" beside the words "Value Label" then click the "Add" button. Follow the same procedure to enter "2" and "Female" then "9" and "Missing." After the value labels have be added, click the "OK" button. Click on the field labeled "Missing" then click on the icon containing the three dots. Select "Discrete missing values" from the popup window, type "9" in one of the three boxes, then click "OK." This tells SPSS to treat respondents coded as "9" on the variable "Sex" as having missing data on the variable. The next two fields are for adjusting the display of information when the "Data View" tab is selected at the bottom left of the screen. It is not usually necessary to change these fields unless you have long text strings as data. We leave them as they are for now. That leaves the "Measure" column. Click on the cell in row 1 under the heading "Measure" then click on the triangle icon to select the appropriate level of measurement. For example, "sex" is a nominal variable so we would select "Nominal." You have now finished defining the first variable. Follow the same procedure for the remaining variables from the "Background Information" section of the questionnaire. Finally, add an additional variable called "idnum" that is numerical, 2 characters wide with no decimals, and label it "Respondents ID Number." It will have no value labels or missing data labels. It is a nominal variable. Save your data definition information as an SPSS system file on the same disk, memory stick, or CD you saved the codebook. I recommend naming it "data1.sav." You do not have to enter the ".sav." SPSS will add this automatically.
Entering Data: Once all the variables in the data set are defined, you are ready to enter data. First click on the "Data View" tab at the bottom left-hand corner of the SPSS window. Notice that now you see the variable names you defined displayed across the top of the screen as column headings. The next step is to take the first of your completed questionnaires and enter the data from that questionnaire in the appropriate fields in row 1. To select a field, simply click on it, or you may use the Tab key to move the next field. After you have entered all the data from the "Background Information" section of the first questionnaire, type the number from the front of the questionnaire in the "idnum" field. Repeat this procedure for the second completed questionnaire. After you have entered data from both completed questionnaires, save the data file. Again, save it as "data1.sav."
What to Turn In: Place the two completed surveys you were given, as well as the one you marked, in a pocket folder, along with a print out of your codebook and the disk, memory stick, or CD on which you saved your files. These items are due by on the due date announced in class.