Unformatted text preview:

1Psychology 210 Statistical Methods Lab January 25, 2007 Lab #2: Importing, exporting and manipulating data Launch SPSS in the usual way, by double-clicking on the desktop icon. Once it’s up and running, open the data file you created last time by selecting the open an existing data source option as you start up. Find the appropriate file from your USB drive, portable disk, network account, etc., and open it. If you already selected a different option, no problem: you can get to the same point by selecting File Æ open Æ data. If you don’t have your data file available, I’ve posted mine on the stats class web page, which you’re free to use today: http://people.whitman.edu/~herbrawt/classes/210/psych210.html. If you use this file, be sure to save it to your desktop before opening it to avoid confusion. Once you’ve got a data file open, take a moment to refresh your memory about the variables and what they mean, so you’re not working blindly with meaningless numbers. A useful thing to know how to do is import data into SPSS from a different program. Sometimes data are gathered automatically by a computer, or are first entered into a different program. In those cases you can pull data directly into SPSS without going to the trouble of retyping them. For example, let’s imagine you were collecting data with a laptop PC which doesn’t have SPSS installed (SPSS is prohibitively expensive!). You could type data into MS Excel and import them to SPSS in the lab later without all the muckety-muck of doing it my hand. To show how this is done, start Excel by selecting from the start menu at the lower left corner of the screen, Start Æ Programs Æ Microsoft OfficeÆ Microsoft Excel. It will open with a new data sheet that looks suspiciously like an SPSS data sheet. Last week we entered information about Liberal arts colleges. To expand on that, we could enter the names of some other colleges we might be interested in, as in the diagram below. Note that you could go all out and enter in all the other variables in subsequent columns if you wanted to. In the interests of time and realism, don’t bother. Since you already know about data entry, we’ll stick with what we have. To move these into SPSS, highlight all the active cells by clicking and dragging to highlight them, as shown in the picture. Once they’re all highlighted, select Edit Æ Copy, and return to SPSS. Click on the first unoccupied line and select Edit Æ Paste (also make sure you’re in the column that represents college name). If you changed the order of your variables, you’ll need to fuss with it to make things line up. Also, if you’re ever pasting in data with labels (such as2calendar type or time zone from last week), copy over the number (e.g., 1) rather than the label (e.g., Semester). SPSS will automatically fill in the appropriate labels for you. OK, now let’s analyze some data! You can run a basic analysis of any variable in the data set by selecting Analyze Æ Descriptive Statistics Æ Descriptives. Let’s get some statistics about the number of students attending the schools in our data set. Select the proper variable by clicking on it, and then on the right-facing arrow. When the variable name has moved over to the variables window in the right, click OK. When this command is executed, a new window will be created (for those with less windows experience, you can switch between the data and output windows by clicking the buttons along the bottom edge of the screen). This is a significant issue because it is now possible to save your data without saving your output, and vice versa. Be careful that you don’t lose something important because you thought you saved it, but didn’t. Output files are distinguishable from data files by their suffix (.spo, rather than .sav). The output window (yours should have similar numbers) presents some basic summary statistics. For example, I can see that the largest school in our sample has 2,845 students. One thing to notice is N, the number of cases. I find it’s a good idea to make sure this matches the number of cases that I think I typed in. If it doesn’t, it’s often a warning sign that something is amiss in my data file. I typed in data for 14 schools, and N is 14, so everything looks good. If you do find any discrepancies, go back to your data and make sure that: A) you entered a value for every school B) you specified any missing values properly (see last week’s lab)3While you’re at it, check to make sure there are no obvious typographical errors – for instance, wildly divergent values under the same variable. There shouldn’t be any, but it’s a good habit to start checking. Hopefully the numbers you get are not wildly different from those in the table above. If they’re not, don’t panic yet. While putting together my data file, I used the values from the US News and World Report pages for consistency. If you got your enrolment numbers from a different source, this could be the reason. Now that we have output, it is sometimes useful to present SPSS output in the context of a different program. For instance, if you’re writing a paper, you might want it in a Word (or other word processor) document, or in a PowerPoint file if you’re doing a presentation. This is a simple process, and the logic to it is very similar to importing data from Excel. Select the desired table on your output window by clicking on it, then select Edit Æ Copy (or press Alt-C). Enter the target program (to start word, select Start Æ Programs Æ Microsoft OfficeÆ Microsoft Word), place your cursor where the table is to be placed and select Edit Æ Paste. The results can be manipulated slightly (for instance, resized) in the new program, but don’t expect to be able to impose major changes. If you’re not happy with the contents of table, it’s best to close the window and have the computer recalculate the statistic with the appropriate settings. In addition to computing statistics, you can use SPSS to create simple graphs. Let’s create a scatterplot that compares the numbers of students and professors. Click Graphs Æ Scatter/dot, and then the button that says simple scatter and then define. The resultant window (to the left) has a list of all your variables to the left. Send the US News and World Report Rank over to the Y axis window by highlighting it, and then clicking on the


View Full Document

Whitman PSYCHOLOGY 210 - Laboratory

Download Laboratory
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Laboratory and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Laboratory 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?