Reading Plain Text Data Files With spss



Download 11.55 Kb.
Date conversion29.04.2016
Size11.55 Kb.
Reading Plain Text Data Files With SPSS

I use SAS to simulate data for my students in my statistics classes. The output data are PUT into simple plain text (*.dat or *.txt) files, with the blank space used as a delimiter. In my undergraduate classes the students use SPSS. Accordingly, they need to know how to read such a file into SPSS, and this document serves as a lesson on doing just that.

From the page at http://core.ecu.edu/psyc/wuenschk/StatData/StatData.htm , download the file Bush-Kerry2004.txt. Then boot up SPSS and click File, Read Text Data. Point to the downloaded data file and then click “Open.”

On Step 1 of the Text Import Wizard, verify that “No” is selected and then click Next.

On Step 2, verify that “Delimited” and “No” are selected and then click Next.

On Step 3, verify that the data begin on line 1 (the variable names are not on line 1 in this file), each line represents one case, and you want to import all the cases. Then click next.

On Step 4, verify that the delimiter is a space and there is no text qualifier, then click Next.

On Step 5 you need to name the variables. Under Data Preview highlight the first column. Then, in the pane above, change “V1” to “IQ.” The data format should be “Numeric.” Then highlight the second column. In the pane above, change “V2” to “State.” The data format should be “String.” In a similar fashion, change V3 to “Income” (numeric), V4 to “Vote” (numeric) and V5 to “Candidate” (string). Click Next.

On Step 6 just click Finish.

The “subjects” here are states in the USA (and the District of Columbia) and the variables are



  • IQ – Estimated mean IQ of residents of the state

  • State – name of the state

  • Income – average income of residents of the state

  • Vote – the state’s electors voted for which candidate in the 2004 election, where 0 = Kerry and 1 = Bush.

  • Candidate – same as vote, but with name of candidate rather than numeric code.

Analyze, Correlate, Bivariate. Scoot all of the numeric variables into the variables box and then click OK.

In the output table each cell gives the value of the Pearson correlation coefficient. Ignore the (Sig) p values – they are inappropriate, given that we have the entire population here, not a random sample from a population. Interpret each of the three correlation coefficients, keeping in mind that the vote variable was coded “0” for Kerry and “1” for Bush.







income

vote

iq




.264

-.349

income







-.635


Interpretation:

There is a medium-sized correlation between IQ and income. States with higher mean IQ also have higher mean income.

This is a medium-sized negative correlation between IQ and voting for Bush. States that went for Bush had lower mean IQ than did states that went for Kerry.

There is a large negative correlation between mean income and voting for Bush. States that went for Bush had lower mean income than did states that went for Kerry



Return to Wuensch’s SPSS Lessons Page

ReadPlainText.docx



The database is protected by copyright ©essaydocs.org 2016
send message

    Main page