Archive for May, 2006

How to create a cross table

The most easy way to present data in a cross table is to use the table function in SPSS. To do this first go to analyze>tables>basic tables. This opens the following screen.
crosstables1.jpg
Now we drag the question “what is your sex?” into down and “SPSS lessons” into across. By clicking statistics we will get the following screen.
crosstables2.jpg
To get the amount and the row percentage into the crosstable, we drag “row%” and “count” into the right box. Now we click continue.
By clicking ok you will get the following cross table:
crosstables3.jpg
Tip: If you want a total percentage or amount in your table, just click on “total” at the basic tables screen, and choose the option “totals over each group variables”.

Files used for this example:

SPSSlog.com example data sheet
SPSSlog.com SPSS file
SPSSLog.com example questionnaire

5 comments May 27th, 2006

How to create a frequency table

The most easy way to present data is to create a table. There are different ways in SPSS to create a table. We will describe the most common way of creating table.
The most common way of creating a table is with the descriptive statistics function. To do this first go to analyze>descriptive statistics>frequencies. This opens the following screen:
tables1.jpg
Now we drag the question “what is your sex?” into the variables. By clicking ok you will get the following tables:
tables2.jpg
The first table shows how many valid cases there are and how many there are missing.
The second table shows:
- The 1st column: This shows the value names and the total.
- The 2nd column: This show the frequency of the values.
- The 3rd column: This shows the percentage of the values including the missing cases.
- The 4th column: This shows the percentage of the values excluding the missing cases.
- The 5th column: This shows the cumulative percentage; this can be important information.

Files used for this example:

SPSSlog.com example data sheet
SPSSlog.com SPSS file
SPSSLog.com example questionnaire

5 comments May 21st, 2006

Make your codebook

This example is based on a market research project. In this project a questionnaire went out and we got a lot of data back from our respondents. To have a guideline when filling in your data, using a codebook is very handy. In fact, it is essential if someone else is filling in data for you. Below you can find an explanation on how to make this codebook.

1. Make a copy of your questionnaire document, and name it e.g. codebook.doc (a little obvious, I know).
2. Change the question numbers into variable names. The most logical thing to do is to give question 1 the variable name q1, question 2 the variable name q2, etc.

SPSSlog.com Codebook

3. Now start coding the answer categories. If your question has only one possible answer, than you can code the first answer as 1, the second as 2.

SPSSlog.com Codebook 2

4. If your question has multiple possible answers, than you should take a different approach. The most handy one is the following. For each possible answer, you make a new variable. For example, the first possible answer for question 11, you give the variable 11a. The second possible answer, give it variable 11b, etc.

SPSSlog.com Codebook multiple choice

After you have done this, you can start define your variables in SPSS.

Files used for this example:

SPSSlog.com example data sheet
SPSSlog.com SPSS file
SPSSLog.com example questionnaire

2 comments May 10th, 2006 andris

How to obtain subgroup Means

Many visitors of our blog are searching for information about the one sample t-test.

From the menus choose: Analyze>Compare Means>Means

Select one or more dependent variables.Use one of the following methods to select categorical independent variables:

Select one or more independent variables. Separate results are displayed for each independent variable.
Select one or more layers of independent variables. Each layer further subdivides the sample. If you have one independent variable in Layer 1 and one independent variable in Layer 2, the results are displayed in one crossed table, as opposed to separate tables for each independent variable.

May 8th, 2006

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

Nominal, ordinal and scale

Today Erik from the Netherlands sent us the following question:

What is the diffrence between nominal, ordinal and scale?

In SPSS you can specify the level of measurement as scale (numeric data on an interval or ratio scale), ordinal, or nominal. Nominal and ordinal data can be either string alphanumeric) or numeric.But what is the difference?

Nominal.
A variable can be treated as nominal when its values represent categories with no intrinsic ranking; for example, the department of the company in which an employee works. Examples of nominal variables include region, zip code, or religious affiliation.A variable can be treated as nominal when its values represent categories with no intrinsic ranking; for example, the department of the company in which an employee works. Examples of nominal variables include region, zip code, or religious affiliation.

Ordinal.
A variable can be treated as ordinal when its values represent categories with some intrinsic ranking; for example, levels of service satisfaction from highly dissatisfied to highly satisfied. Examples of ordinal variables include attitude scores representing degree of satisfaction or confidence and preference rating scores.

A variable can be treated as ordinal when its values represent categories with some intrinsic ranking; for example, levels of service satisfaction from highly dissatisfied to highly satisfied. Examples of ordinal variables include attitude scores representing degree of satisfaction or confidence and preference rating scores.For ordinal string variables, the alphabetic order of string values is assumed to reflect the true order of the categories. For example, for a string variable with the values of low, medium, high, the order of the categories is interpreted as high, low,mediumwhich is not the correct order. In general, it is more reliable to use numeric codes to represent ordinal data.

Scale.
A variable can be treated as scale when its values represent ordered categories with a meaningful metric, so that distance comparisons between values are appropriate. Examples of scale variables include age in years and income in thousands of dollars.A variable can be treated as scale when its values represent ordered categories with a meaningful metric, so that distance comparisons between values are appropriate. Examples of scale variables include age in years and income in thousands of dollars.

(Source: SPSS User Guide)

15 comments May 3rd, 2006

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 data into SPSS

Importing some data

If you have a small amount of data you want to get into SPSS, the most easy way is to simply Copy Paste it into SPSS. Be aware to check if everything ends up in the right cell, and if  you really have all the data you need. The most safe way to get this data into SPSS, would be to import it. Especially if you have a lot of data.

Importing a lot of data

There are a number of file formats SPSS can import data from. In general it is handy – but optional – to have a header row in the top of your file with descriptions of the columns. This means that you add one line before all the cases, where you put the name of the column (or variable).

Importing data from an Excel file
Importing data from an ASCII file
Importing data from a tab delimited text file

5 comments May 3rd, 2006 andris

How to handle multiple response questions

In a lot of research, multiple answers can be given to a single question. For example:

“What kind of food do you like?”
o soup
o rice
o salad

How do you analyse this type of question? Let’s assume you want to make a table with the answers. How do you combine them? Even though it may seem like the most easy thing to do, this is pretty difficult stuff. SPSS is good at analyzing unique combinations of variables (answers to questions) combined with unique cases (people in a survey). The combination of more than one answer per person, does not fit into that logic. So we have to be a little creative.

There are – at least – four different ways to analyze these results. They all have advantages and disadvantages, so it really comes down to your preferences:

1) Create separate variables for each answer 
varsoup (0 = not ticked, 1 = ticked)
varrice (0 = not ticked, 1 = ticked)
varsalad (0 = not ticked, 1 = ticked)

If you’re not entering the data yourself, chances are that this is what your data-set will look like if there was a multiple question in the survey. With three separate variables, you can create three tables using the frequencies-command. The advantage of this approach is its simplicity, the disadvantage is that you have three separate tables. You cannot tell if the three answers were in any way linked to one another.

2) Make a ‘grouping variable
a. Follow the steps in option 1, creating separate variables for each answer
b. Create a new variable: the ‘grouping variable’. Select analyze > tables > multiple response sets… Select all variables from the list you want to group together and click them into the right window ‘Variables in set’. Choose the ‘counted value’: this is the value that you want to count as ‘yes’. In our example, this is the value 1. Give the new variable a name, for instance ‘varfood’. Click ‘add’, and ‘OK’. Your new grouping variable will appear with a $ in front in de list to the right of the screen: ‘$varfood’. The $-sign tells you this is a variable containing several variables.

To make a table, select analyze > tables > multiple response tables… In the window to the bottom-left of the screen, you see grouping variables. Click the one you want and click it into the ‘Rows’ box. Click OK and you’re done.

3) Several variables with a hierarchy
In order to be able to use this method, it would be nice if your survey also asked to rank the three items available. If that’s not the case, you will have to decide for yourself which answer is most important and label that one first answer.

This will lead to:

varfood1 (1 = soup, 2 = rice, 3 = salad) label “First answer”
varfood2 (1 = soup, 2 = rice, 3 = salad) label “Second answer”
varfood3 (1 = soup, 2 = rice, 3 = salad) label “Third answer”

4) Create a variable with a single value for each possible combination
This will lead to:

varfood

1 = soup,
2 = rice,
3 = salad,
4 = soup and rice,
5 = soup & salad,
6 = rice and salad,
7 = soup and rice and salad

The disadvantage is that this can be quite some work when you’ve got more than three answers. And you also run the risk of not being able to interpret your resulting table at a glance: the number of cases per option can be quite small. This is really only a serious option if you want to know exactly what each person answered. Pay attention to the order of the answers: if you start off with those combinations that were pretty popular, they will be at the top of your table, making it easier to interpret the results.

(Thanks to Sander for answering this question)

27 comments May 2nd, 2006

Previous Posts


Calendar

May 2006
M T W T F S S
« Apr   Aug »
1234567
891011121314
15161718192021
22232425262728
293031  

Posts by Month

Posts by Category