Posts filed under '1. Getting data into SPSS'

Importing data from an ASCII file

First refer to Importing data into SPSS. If you have read it, than you can continue below.
Typically, columns of data in an ASCII file are separated by a space, tab, comma, or some other character. SPSS has a Text Import Wizard that will help you import data in an ASCII file format:

1. Select File -> Open -> Data
2. Choose Text as the File Type if your ASCII file has the .txt extension. Otherwise you could choose the option All files
3. Select the file you want to import and click Open

Importing an ASCII file Open File

4. The next thing that will pop up is the Import text wizard. First click Next if your file does not match a predefined format. It probably doesn’t, so click Next.

Importing an ASCII file step 1

5. In step 2, you can set the first question to Delimited. In the second question you choose wether you have a header row or not (are variables names included in the top of the file). After setting the options right, choose Next.

Importing an ASCII file step 2

6. In step 3, set the line where the first case of your data begins (normally on line 1), set how your cases are represented (normally each line represents a case), and how many cases you want to import (choose for yourself, normally you import All of the cases. Click Next.

Importing an ASCII file step 3

7. In step 4, set the delimiters of your file (probably comma or space). If your text has quotes (or anything else) around it, than specify this. In most cases you can just set it to None. As you can see, based on the choices you make here, SPSS already formats the file in the small screen in the bottom. There you can check if everything is set correctly. Choose Next when it looks fine.

Importing an ASCII file step 4

8. In step 5 you can set the specifications for the variables, but you can just skip it if you have already defined your variables or want to do it later.

Importing an ASCII file step 5

9. In step 6 you can just leave all the options as they are, and click Finish. You’re done!

Importing an ASCII file step 6

3 comments May 3rd, 2006 andris

Import data from an Excel file

First refer to Importing data into SPSS. If you have read it, than you can continue below.
Before you start the actual import process, please keep in mind that the Excel file should not be opened in Excel.

1. Select File -> Open -> Data
2. Choose Excel as the File Type
3. Select the file you want to import and click Open

Importing Excel file Open Excel Data Source 

4. The next thing that will pop up is a screen called Opening Excel Data Source. If you use a header row, than tick the option Read variable names from the first row of data. Select the right worksheet you want to import from (the same as the tabs in Excel). If you have no clue, leave it as is. It will probably select the right one automatically. If you do not want to import the whole worksheet, you can use the field Range to define the cells you want to import, otherwise just leave empty. Click OK.

Importing Excel file Open file

SPSS will automatically determine the type of each variable, so after you clicked OK, you are ready!

8 comments May 3rd, 2006 andris

Import data from a tab delimited text file

First refer to Importing data into SPSS. If you have read it, than you can continue below.

1. Select File -> Open -> Data
2. Choose Text as the File Type
3. Select the file you want to import and click Open

Open tab delimited text file

4. The next thing that will pop up is the Import text wizard. First click Next if your file does not match a predefined format. It probably doesn’t, so click Next. :)  

Importing a tab delimited text file step 1

5. In step 2, you can set the first question to Delimited. In the second question you choose wether you have a header row or not (are variables names included in the top of the file). After setting the options right, choose Next.

Importing a tab delimited text file step 2

6. In step 3, set the line where the first case of your data begins (normally on line 1), set how your cases are represented (normally each line represents a case), and how many cases you want to import (choose for yourself, normally you import All of the cases. Click Next.

Importing a tab delimited text file step 3 

7. In step 4, set the delimiters of your file (Tab it would be). If your text has quotes (or anything else) around it, than specify this. In most cases you can just set it to None. As you can see, based on the choices you make here, SPSS already formats the file in the small screen in the bottom. There you can check if everything is set correctly. Choose Next when it looks fine.

Importing a tab delimited text file step 4 

8. In step 5 you can set the specifications for the variables, but you can just skip it if you have already defined your variables or want to do it later. Choose Next.

Importing a tab delimited text file step 5

9. In step 6 you can just leave all the options as they are, and click Finish. You’re done!

Importing a tab delimited text file step 6

3 comments May 3rd, 2006 andris

Importing Excel file into SPSS

This weekend we got a question from Zakya, who desperately needs information on how to import Excel data into SPSS.

Actually, importing from SPSS is not that hard at all. But before you import, there are some steps to take to make importing more easy:

- Close the Excel file (otherwise SPSS will give an error message)
- Make a header row in Excel with column names (keep them brief and descriptive)
- Do not mix up numbers and text in the same column

In SPSS, select Open -> File from the menu. In the Open file dialog, select Excel file as file type. Browse to the right directory and select the Excel file. Click Open. After this, you will get a new dialog (Hurray!) “Opening Excel Data Source”. If you have made a header row with column names, check the box “Read variable names from the first row of data”. If you do not have other irrelevant data in your Excel file, just click OK. Otherwise select the right worksheet and range, and click OK. If everything went allright, you now have your data in SPSS. Now you can start adjusting the Variables to the right types etc.

3 comments April 10th, 2006 andris


Calendar

September 2011
M T W T F S S
« Apr    
 1234
567891011
12131415161718
19202122232425
2627282930  

Posts by Month

Posts by Category