Lec1 2

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 26

1

Introduction
SPSS stands for Statistical Package for the Social Sciences. It is a popular software used to
analyze statistical data in different fields including business, social sciences, health sciences. We
will use the graphical interface of version 25.

SPSS provides descriptive statistics: Examples include graphical ( such as bar graph, histogram),
tabular (such as frequency tables, cross-tabulation), numerical measures ( such as median, range,
variance and standard deviation), and prediction (such as regression analysis).

SPSS provides Inferential statistics: such as confidence intervals and hypothesis testing.

After studying the theoretical part of the Statistics course you will use the computer (SPSS) to
apply the theoretical material. You will gain some knowledge and skills in how to use SPSS.

This manual assumes that you are familiar with Windows packages such as Word and Excel.
This manual illustrates how to apply SPSS procedures to all theoretical statistical procedures covered
in Econ234 course.

Econ 234 – Dr. Rabie


2

Chapter 1
1.1 Loading SPSS

Turn on your computer.

Click on windows icon

Type in SPSS in the dialogue box and highlight (or click) IBM SPSS Statistics 25
You will see the following window- Click Cancel and SPSS editor will appear.

When you load and run the SPSS package it opens up a menu bar and two views. These are Data
View(currently visible) and Variable View

Econ 234 – Dr. Rabie


3

This sheet will contain your data, each column representing a variable for which data
are available and each row representing the data for an individual or case. At present this sheet
should be blank. As this sheet is currently selected, its name on the tab at the bottom is in bold.
This is the data editor window.

At present this sheet is not visible as the variable view sheet is not active.
Consequently, the name is not in bold.

Menu Bar: This provides a selection of options (File, Edit, View, Data …) which allow you, for
example, to open files, edit data, generate graphs, create tables and perform statistical analyses.
Selecting from this menu bar will, as in other Windows packages, provide further pull‐down
menus and dialogue boxes.

Some important menu bar options:

File is used to access any files whether you want to Open an existing SPSS file or read data from
another application such as Excel or dBase, or start a New file. It is also the menu option you
choose to Save files.

Edit can be used to alter data or text in the Data View or the Variable View.

View can be used to alter the way your screen looks such as font size

Econ 234 – Dr. Rabie


4

Data is used to define variables and make changes to the data file you are using.

Transform is used to make changes to selected variable(s) in the data file you are using. We focus
on recode existing variable, compute new variables.

Analyze is used to undertake a variety of analyses such as producing Reports, calculating


Descriptive Statistics such as Frequencies and Crosstabs (crosstabulation) and associated
summary statistics, as well as various statistical procedures such as Regression and Correlation.

Graphs is used to create a variety of graphs and charts such as Bar, Line and Pie charts.

Window operates in the same way as other Windows packages.

Help is a context‐sensitive help feature which operates the same way as other Windows packages.

1.2 How to enter data into SPSS


Let us enter the following data into SPSS, which represent the gender (qualitative) and age
(quantitative) for four students in your class.

In the Variable View window enter the two variable’s names gender and age.
Note that

1. The default is “numerical” under the Type column and “Scale” under Measure
column. You should keep these setting for the age variable because it is a quantitative
variable.

2. gender is a qualitative variable so you need to select “String” from the Type column.
By default the Measure column will show “nominal”.
In the Data View window enter the gender and the age values for the four subjects.

subject gender age

1 female 20

2 Male 21

3 Male 22

4 female 20

When you are done you will see the following in the data view window

Econ 234 – Dr. Rabie


5

Then click Open.

Econ 234 – Dr. Rabie


6

Chapter 2
2.1 Presenting qualitative data graphically

2.1.1 Bar Graph

The bar graph displays a qualitative data with two or more categories. We could use one
variable to compare its categories or to compare categories of two or more variables/.

2.1.1.1 One independent variable

Example 1: Create a frequency table and a bar graph for the favorite flavor of ice cream variable
in ice_cream.sav data.

Open data “ice_cream.sav”

Analyze - Descriptive Statistics- Frequencies

Move the variable ice-cream to Variables dialogue box

Click on Chart and select Bar charts

You will see the following window:

Econ 234 – Dr. Rabie


7

Then select Frequencies (or percentages) from chart values

Click Continue- OK.

favorite flavor of ice cream

Cumulative
Frequency Percent Valid Percent Percent

Valid vanilla 95 47.5 47.5 47.5

chocolate 47 23.5 23.5 71.0

strawberry 58 29.0 29.0 100.0

Total 200 100.0 100.0

Econ 234 – Dr. Rabie


8

2.1.1.2 Summarized data


Example 1: How much is spent on back-to-college shopping by the average student? Here is the
data summarized in a frequency table.

Category (ExpendCat) Amount spent in $ US (AmountSpent)


Electronics 211.89
Clothing 134.4
Dorm Furnishings 90.9
School supplies 68.47
Miscellaneous 93.72

Enter data into SPSS editor window. You need to create two variables: expenditure, our only
categorical variable (qualitative) and the amount spent (count -quantitative). Save the data to be
used later.

SPSS needs to know that the total expenditure is 599.38 ( sum of all expenditures in all categories).

To do so, go to

Data – Weight Cases


select Weight Cases by
Move the AmountSpent variable to Frequency Variables dialog box. Then click OK.

Econ 234 – Dr. Rabie


9

Econ 234 – Dr. Rabie


10

Now you can create the bar graph as follows:

Analyze - Descriptive Statistics- Frequencies

Move ExpendCat to Variables dialogue box

Click on Chart and select Bar charts

Then select Frequencies (or percentages) from chart values

Click Continue- OK.

You will see the following output

Econ 234 – Dr. Rabie


11

Exercise: Problems 2.11 and 2.13 on page 32.

2.1.1.3 Two independent variables

Example 1: In the ice cream data, suppose you are interested in how gender might affect the
favorite flavor of ice cream. You could look at the a bar graph of favorite flavor of ice cream by
gender.

Open “ice_cream.sav ” data

Graph – Legacy dialogs- Bar

Econ 234 – Dr. Rabie


12

Make sure that Summaries for groups of cases is selected.

Select Clustered then click on Define

Move ice_cream into Category Axis

Move gender into Define clusters by

Econ 234 – Dr. Rabie


13

Click OK.

You will see

Econ 234 – Dr. Rabie


14

Exercise: Two independent variables (summarized data)


The following table summarized the number and type of fruits sold in a school canteen during
the months September and October in the last year. Give a Bar graph that shows the type of fruit
by month.

Month /Fruit Apple Orange Banana


Sep 25 8 30
Oct 35 12 60

Econ 234 – Dr. Rabie


15

2.1.2 Pie Chart


Pie chart is a display that compares sizes of a categorical variable.

2.1.2.1 Pie chart for one variable

Example: Use data “ice_cream.sav”

Analyze- Descriptive Statistics- Frequencies


Move the variable ice-cream to Variables dialogue box

Click on Chart and select Pie chart

Then select Frequencies (or percentages) from chart values


Click Continue- OK.
Note: double click on the picture you get (pie chart) and do the following to insert percentages
for each category:

In the Chart Editor window

Econ 234 – Dr. Rabie


16

Elements – Show Data Labels


Choose Percent then Close.
graph

You will see the following output

2.1.2.2 One Summarized variable


Use the same example in 2.1.1.2 Section to create a pie chart.

Category (ExpendCat) Amount spent in $ US (AmountSpent)


Electronics 211.89
Clothing 134.4

Econ 234 – Dr. Rabie


17

Dorm Furnishings 90.9


School supplies 68.47
Miscellaneous 93.72

Open Data and remember to use the weighted cases procedure for this type of data.

Graph – Legacy dialogs- Pie.

Make sure that Summaries for groups of cases is selected

Click on Define

Select Sum of Variables and move AmountSpent into Variable box

Move ExpendCat into Define Slices By dialogue box

Econ 234 – Dr. Rabie


18

Continue-OK.
You will get

Econ 234 – Dr. Rabie


19

Double click on the chart to display percentages and labels as in 2.1.2.

2.2 Presenting quantitative data graphically


2.2.1 Line Graph
A line graph displays quantitative data and shows information that is connected in some way such
as data over time.

Example: Use data sales. The data show the sales in thousands of dollars of a product over a
period of years. Create a line graph for the sales over time.

Econ 234 – Dr. Rabie


20

Example 1: Create a line graph for the following data which show the English exam scores of a
student

3, 5, 3, 6, 7, 7, 7, 6, 6, 8.

Enter data into SPSS and name this variable score -

Graph – Legacy dialogs- Line.


Make sure that Values of individual case is selected.

Select Simple then click on Define

Econ 234 – Dr. Rabie


21

Move the variable score into Line represents dialog box – OK.
The following graph appears.

Econ 234 – Dr. Rabie


22

2.2.2 Histogram
A histogram summarizes a univariate variable graphically. It shows the distribution of the
variable which can be symmetric or skewed.

Example 1:
Create a histogram for the variable “video” (the score on a video game) in ice-cream data

Analyze – Descriptive Statistics - Frequencies


Click on Charts and select Histogram

then Continue- OK.

Econ 234 – Dr. Rabie


23

2.3 Presenting data numerically

For quantitative variables, we will find all measures of central tendency and dispersion (variation).

Data: ice_cream.sav

Econ 234 – Dr. Rabie


24

We are interested in getting the value of mean, median, mode, min, max, Percentiles 60 and 90,
quartiles, variance, standard deviation, and the Range. Find these measurement for the puzzle
variable.

Analyze – Descriptive Statistics- Frequencies


Move the puzzle variable to the box under Variables
Make sure that Display frequency tables is NOT selected.

Click on Statistics and mark all the required boxes such as mean, median, mode,…

SPSS output is shown below:

Econ 234 – Dr. Rabie


25

Statistics
score on puzzle game

N Valid 200

Missing 0
Mean 52.41
Median 52.00
Mode 61
Std. Deviation 10.736
Variance 115.257
Range 45
Minimum 26
Maximum 71
Percentiles 25 46.00

50 52.00

60 56.00

75 61.00

Econ 234 – Dr. Rabie


26

Note You could use the following procedure to get some statistics for
the video variable:
Analyze – Descriptive Statistics - Descriptives.

Move video variable into variables window

Click OK.
Descriptive Statistics

N Minimum Maximum Mean Std. Deviation

score on video game 200 26 74 51.85 9.901


Valid N (listwise) 200

Econ 234 – Dr. Rabie

You might also like