SPSS Data Handling and Analysis Guide
SPSS Data Handling and Analysis Guide
Data handling: open SPSS data file, save – import from other data source, data entry – labelling, or
dummy numbers, Simple Bar diagram, Multiple bar diagram, Sub-divided Bar diagram, Pie
Diagram, Frequency Table, Histogram, Scatter diagram
Data handling refers to the process of managing, organizing, and manipulating data to extract
meaningful information and insights. It involves tasks such as data collection, data entry, data
cleaning, data transformation, data analysis, and data visualization. Here are some key aspects of
data handling:
Data Collection: This step involves gathering data from various sources, such as surveys,
experiments, observations, or existing databases. It's important to ensure that data collection
methods are reliable and appropriate for the research or analysis goals.
Data Entry: After data collection, the information needs to be entered into a digital format, such as
a spreadsheet or a database. Accurate and consistent data entry is crucial to maintain data integrity.
Data Cleaning: Data cleaning or data cleansing involves identifying and correcting errors,
inconsistencies, and missing values in the dataset. This step ensures that the data is reliable and
ready for analysis.
Data Transformation: Data transformation involves converting the data into a suitable format for
analysis. This may include aggregating data, creating new variables, standardizing units, or
performing calculations.
Data Analysis: Once the data is cleaned and transformed, various statistical and analytical
techniques can be applied to gain insights and draw conclusions. This may involve descriptive
statistics, inferential statistics, regression analysis, clustering, or machine learning algorithms.
Data Visualization: Data visualization is the process of representing data graphically to facilitate
understanding and communication of insights. Charts, graphs, and other visual representations can
be used to present patterns, trends, and relationships in the data.
Data Storage and Documentation: It is essential to store the data securely and maintain proper
documentation, including metadata, to ensure data integrity and reproducibility. This
documentation should include details about the data collection methods, variables, and any
transformations performed.
Effective data handling practices are crucial for accurate and reliable analysis, enabling researchers
and analysts to make informed decisions based on the data.
1.2 SPSS:
SPSS (Statistical Package for the Social Sciences) is a software program widely used for statistical
analysis, data management, and data visualization. It provides a comprehensive set of tools and
features for handling and analyzing data, particularly in the social sciences and market research
fields. Here are some key aspects of SPSS:
Page 1
Data Entry: SPSS allows you to enter data manually using its Data Editor interface or import data
from various file formats, including Excel, CSV, and text files. The Data Editor provides a
spreadsheet-like environment for entering and organizing your data.
Data Management: SPSS offers numerous functions for managing and manipulating your data. You
can perform tasks such as recoding variables, computing new variables, merging datasets, sorting
data, and filtering cases.
Descriptive Statistics: SPSS provides a range of descriptive statistics to summarize and explore
your data. You can calculate measures such as means, medians, standard deviations, frequencies,
and percentages for individual variables or across groups.
Inferential Statistics: SPSS offers a wide array of statistical tests for hypothesis testing and
inferential analysis. It includes parametric tests (e.g., t-tests, ANOVA, regression) and non-
parametric tests (e.g., chi-square, Mann-Whitney U, Kruskal-Wallis) to analyze relationships and
differences in data.
Data Visualization: SPSS enables you to create various charts, graphs, and plots to visually
represent your data. You can generate histograms, bar charts, scatterplots, line charts, and more to
explore patterns, trends, and relationships within your data.
Output and Reporting: SPSS generates output files that summarize the results of your analyses.
These output files contain tables, charts, and statistical information. You can export the output to
different file formats, including Word, Excel, PDF, or HTML, for further analysis or reporting.
Syntax and Programming: SPSS allows you to automate and replicate your analyses using syntax
or programming. SPSS syntax is a programming language that enables you to write scripts to
perform data manipulation, analysis, and reporting tasks.
SPSS is widely used in academia, market research, healthcare, and other fields where data analysis
and statistical modeling are required. It provides a user-friendly interface combined with powerful
analytical capabilities, making it a popular choice for data handling and statistical analysis tasks.
Page 2
1.3 Open SPSS data file
1. Launch SPSS: Locate the SPSS software on your computer and open it.
2. Load the data file: Once SPSS is open, go to the "File" menu at the top left corner and select
"Open" or use the keyboard shortcut "Ctrl + O."
3. Browse for the file: A dialog box will appear. Navigate to the folder where your SPSS data file
is saved.
4. Select the data file: In the dialog box, choose the SPSS data file you want to open. The file
extension should be ".sav".
5. Click "Open": After selecting the file, click the "Open" button.
6. Explore the data: The SPSS software will load the data file, and you will be able to see the
variables and data in the Data Editor window.
Now you have successfully opened an SPSS data file in the SPSS software. You can analyze and
manipulate the data using SPSS's various features and tools.
1) Once you have entered your data and performed any necessary analyses or transformations, go
to the "File" menu located at the top-left corner of the SPSS window.
2) Click on "Save" or "Save As" from the drop-down menu. If you choose "Save," SPSS will save
the file in its current location and overwrite the existing file if it already exists. If you choose
"Save As," a dialog box will appear where you can specify the file name, location, and format.
3) In the "Save As" dialog box, choose the location where you want to save the file. You can
navigate through your file system and select the desired folder or directory.
4) Enter a name for your file in the "File name" field. SPSS files typically have the extension ".sav"
(e.g., "[Link]").
Page 3
5) Choose the desired format from the "Save as type" dropdown menu. The default format is SPSS
(.sav), but you can also choose other formats such as Excel (.xls, .xlsx), comma-separated values
(.csv), or other formats depending on your needs.
6) Click on the "Save" button to save the file with the specified name and format.
SPSS will now save your file in the specified location and format. You can access the saved file at
any time for further analysis or to share with others.
To import data from other sources into SPSS, you can use the "File" menu or the syntax commands.
Here's a step-by-step guide for both methods:
Method 1: Importing data using the SPSS GUI (Graphical User Interface):
Go to "File": Click on the "File" menu at the top left corner of the SPSS window.
Choose File Type: In the "Open Data" dialog box, select the appropriate file type that matches your
data source. For example, you can select "Excel" for an Excel file or "Text (delimited)" for a CSV
file.
Locate the File: Browse to the location where your data file is stored and select the file you want to
import.
Configure Import Options: Depending on the file type, you may need to configure import options
such as specifying the worksheet or delimiter settings. Follow the prompts or dialog boxes to set
these options accordingly.
Page 4
Review Variable Settings: SPSS will automatically assign variable names and data types based on
the imported file. Review these settings and make any necessary adjustments before proceeding.
Finish Importing: Once you have configured the import options, click "OK" or "Finish" to complete
the import process. SPSS will load the data into the Data Editor window.
Open the Syntax Editor: Go to the "Utilities" menu at the top of the SPSS window and select
"Syntax Editor."
Write Syntax: In the Syntax Editor, write the import command using the appropriate syntax for your
data source. For example, to import an Excel file, you can use the following command:
Page 5
Customize Options: Adjust the options within the command, such as the file path, sheet name, and
other settings, to match your data source and requirements.
Run Syntax: After writing the syntax, you can run it by clicking the "Run" button or by pressing
"Ctrl + R." SPSS will execute the syntax and import the data into the Data Editor.
These methods allow you to import data from various file formats, including Excel, CSV, SPSS
data files, and more. By following these steps, you can bring external data into SPSS for further
analysis and manipulation.
Page 6
To perform data entry in SPSS, you can follow these steps:
1) Launch SPSS: Open SPSS on your computer. Once it's open, you will see a blank data editor
window.
2) Define variable names: In the first row of the data editor, enter the names of the variables you
want to include in your dataset. Each variable name should be entered in a separate column.
Make sure to use meaningful and descriptive variable names.
3) Define variable properties: In the second row of the data editor, specify the properties of each
variable. This includes the type of data (numeric, string, etc.), measurement level (nominal,
ordinal, interval, ratio), and any other variable properties.
4) Enter data: Start entering your data in the rows below the variable names. Each row represents
a case or an observation, and each column represents a variable. Enter the values for each
case/observation according to the variable type and measurement level.
5) Save your data: Once you have entered all the data, save your dataset. Go to "File" in the menu
bar and select "Save" or "Save As" to save the data in SPSS format (.sav) or any other desired
format.
Page 7
1.7 Labeling variables in SPSS
In SPSS, you can assign labels to variables and their values to provide meaningful descriptions for
easier understanding and analysis. Here's how you can label variables and values in SPSS:
Labeling Variables:
Once you have assigned labels to variables and values, they will be displayed in the "Variable View"
and can provide additional context when working with your data.
Page 8
It represents only one variable. For example, sales, production, population figures, etc. for various
years may be shown by simple bar charts. It consists of a group of equidistant rectangles or bars
(horizontal or vertical), one for each group or category of data in which the values or magnitudes
are represented by the length or height of the rectangles, the width or the rectangles being arbitrary
and immaterial. Since these are of the same width and vary only in heights (or lengths), it becomes
very easy for readers to study the relationship. Simple bar diagrams are very popular in practice.
A bar chart can be either vertical or horizontal; vertical bars are more popular.
Illustration: The following table gives the birth rate per thousand of different countries over a
certain period of time.
India 33
Germany 15
U. K. 20
China 40
New Zealand 30
Sweden 15
Comparing the size of bars, you can easily see that China's birth rate is the highest while Germany
and Sweden equal in the lowest positions. Such diagrams are also known as component bar
diagrams.
To create a simple bar diagram in SPSS, you can follow these steps:
Page 9
7. Drag and drop the "Simple Bar" chart icon onto the chart canvas area.
8. In the "Variables" section on the right side of the Chart Builder dialog box, select the categorical
variable you want to use for the bar chart and drag it into the "X-Axis" box on the chart canvas
area.
9. If you want to display frequencies or percentages on the y-axis, drag and drop the variable into
the "Y-Axis" box on the chart canvas.
10. Click the "OK" button to generate the bar chart.
SPSS will generate the simple bar chart based on your selected variable(s) and display it in a new
chart window. You can customize the chart's appearance, labels, colors, and other settings using the
various options available in SPSS's chart editor.
This method can be used for data which is made up of two or more components. In this method the
components are shown as separate adjoining bars. The height of each bar represents the actual value
of the component. The components are shown by different shades or colors. Where changes in
actual values of component figures only are required, multiple bar charts are used.
Illustration:- The table below gives data relating to the exports and imports of a certain country X
( in thousands of dollars ) during the four years ending in 1930 - 31.
To create a multiple bar diagram (also known as a grouped bar chart or clustered bar chart) in SPSS,
you can follow these steps:
Page 10
1. Open your SPSS dataset or create a new one.
2. Go to the "Variable View" by clicking on the tab at the bottom left of the SPSS window.
3. Ensure that you have at least two categorical variables for which you want to create a multiple
bar diagram. If not, you may need to recode or create new variables based on your data.
4. Go to the "Data View" by clicking on the corresponding tab at the bottom left of the SPSS
window.
5. Go to "Graphs" in the menu bar at the top of the SPSS window and select "Chart Builder."
6. In the "Gallery" section on the left side of the Chart Builder dialog box, click on the "Bar" chart
type.
7. Drag and drop the "Clustered Bar" chart icon onto the chart canvas area.
8. In the "Variables" section on the right side of the Chart Builder dialog box, select the categorical
variables you want to use for the multiple bar chart and drag them into the "X-Axis" box on the
chart canvas area.
9. If you want to display frequencies or percentages on the y-axis, drag and drop the variable(s)
into the "Y-Axis" box on the chart canvas.
10. Click the "OK" button to generate the multiple bar chart.
SPSS will generate the multiple bar chart based on your selected variables and display it in a new
chart window. Each group of bars represents a different category from one of the variables, and the
bars within each group represent the values of the other variable. You can customize the chart's
appearance, labels, colors, and other settings using the various options available in SPSS's chart
editor.
While constructing such a diagram, the various components in each bar should be kept in the same
order. A common and helpful arrangement is that of presenting each bar in the order of magnitude
with the largest component at the bottom and the smallest at the top. The components are shown
with different shades or colors with a proper index.
Illustration: During 2000-03, the number of students in University ' X ' are as follows. Represent
the data by a suitable diagram.
Page 11
To create a sub-divided bar diagram (also known as a stacked bar chart or stacked column chart) in
SPSS, you can follow these steps:
SPSS will generate the sub-divided bar chart based on your selected variables and display it in a
new chart window. Each bar is divided into segments representing different sub-categories within
the main categories. You can customize the chart's appearance, labels, colors, and other settings
using the various options available in SPSS's chart editor.
The more commonly used diagram than square diagrams is the pie or circular or angular diagram.
Geometrically it can be seen that the area of a sector of a circle taken radically, is proportional to
the angle at its center. It is therefore sufficient to draw angles at the center, proportional to the
original figures. This will make the areas of the sector proportional to the basic figures.
For example, let the total be 1000 and one of the component be 200, then the angle will be
When a statistical phenomenon is composed of different components which are numerous (say four
or more components), bar charts are not suitable to represent them because, under this situation,
they become very complex and their visual impressions are questioned. A pie diagram is suitable
for such situations. It is a circular diagram which is a circle (pie) divided by the radii, into sectors (
like slices of a cake or pie ). The area of a sector is proportional to the size of each component.
Page 12
Tuition fees Rs. 6,000
Books and lab. Rs. 2,000
Clothes / cleaning Rs. 2,000
Room and boarding Rs. 12,000
Transportation Rs. 3,000
Insurance Rs. 1,000
Sundry expenses Rs. 4,000
Now as explained above, we calculate the angles corresponding to various items (components).
Tuition fees =
Clothes / cleaning =
Transportation =
Insurance =
Sundry expenses =
Uses:- A pie diagram is useful when we want to show relative positions ( proportions ) of the figures
which make the total. It is also useful when the components are many in number.
Page 13
Note:- The sectors of the circle ( i.e. of a pie diagram) are ordered from largest to the smallest for
easier interpretation of the data and they must be drawn in the counter-clockwise direction.
To create a pie diagram (also known as a pie chart) in SPSS, you can follow these steps:
SPSS will generate the pie chart based on your selected variable and display it in a new chart
window. Each slice of the pie represents a category or group, and the size of each slice corresponds
to the proportion or frequency of that category. You can customize the chart's appearance, labels,
colors, and other settings using the various options available in SPSS's chart editor.
It is a quantitative classification of a statistical data. Suppose the data collected are the number of
persons in different age groups in a sample of 100 in village. This data has to be presented in the
form of table to enable the statistician to make further analysis and interpretation of the data. The
above data can be presented in the form of a table as below:
The above table is called a frequency table. The ranges 0-9, 10-19, etc. are called classes and the
number of persons in these ranges are called frequencies. The whole data arranged in this form is
called a frequency distribution.
Page 14
A frequency table divides observations in the data set into conveniently established numerically
ordered classes (groups or categories). The number of observations in each class is referred to as
frequency denoted as f.
145 126 132 128 131 140 141 142 144 142 135 136 138
133 143 128 131 140 130 129 128 134 136 139 141 144
134 135 139 142 133 133 121 125 125 131 134 136 139
Raw Data
141 129 124 132 139 144 143 140 140 131 139 132 135
135 129 135 132 143 143 145 140 138 137 136 130 129
128 136 133 134 142 140 139 136 142 140 130 125 129
139 141 144 143 133 136 139 129 131 135 145 140 142
139 129 127 127 137 135 137 139 145
Solution:
Here the largest value is 145 and the smallest value is 121. We will have 5 class intervals.
Therefore, the width of the class interval can be calculated as (145 – 121)/5 = 24/5 5. Therefore,
the classes are 121-125, 126-130, 131-135, 136-140, 141-145. Let us prepare the frequency tally.
Class Frequency
121-125 5
126-130 17
131-135 25
136-140 30
141-145 23
Total 100
Page 15
5. Select the variable(s) for which you want to create a frequency table and move them to the
"Variable(s)" box on the right side. You can select multiple variables by holding down the Ctrl
key (Command key on Mac) while clicking on the variables.
6. Optionally, you can choose additional options such as statistics, format, and display in the
"Statistics" and "Chart" tabs to customize the output.
7. Click the "OK" button to generate the frequency table.
SPSS will generate the frequency table based on your selected variable(s) and display it in the
"Output Viewer" window. The frequency table provides the counts and percentages for each
category of the variable(s) you selected. You can also export the frequency table to a separate file
or copy it to another application for further analysis or reporting.
1.12 Histogram
To construct a Histogram, the class intervals are plotted along the x-axis and corresponding
frequencies are plotted along the y - axis. The rectangles are constructed such that the height of
each rectangle is proportional to the frequency of the class and width is equal to the length of the
class. If all the classes have equal width, then all the rectangles stand on the equal width. In case
of classes having unequal widths, rectangles too stand on unequal widths (bases). For open-classes,
Histogram is constructed after making certain assumptions. As the rectangles are adjacent leaving
no gaps, the class-intervals become of the inclusive type, adjustment is necessary for end points
only.
For example, in a book sale, you want to determine which books were most popular, the high priced
books, the low priced books, books most neglected etc. Let us say you sold 31 books at this book-
fair at the following prices.
$2, $ 1, $ 2, $ 2, $ 3, $ 5, $ 6, $ 17, $ 17, $ 7, $ 15, $ 7, $ 7, $ 18, $ 8, $ 10, $ 10, $ 9, $ 13, $ 11, $
12, $ 12, $ 12, $ 14, $ 16, $ 18, $ 20, $ 24, $ 21, $ 22, $ 25.
The books are ranging from $1 to $25. Divide this range into number of groups, class intervals.
Typically, there should not be fewer than 5 and more than 20 class-intervals are best for a
frequency Histogram.
Our first class-interval includes the lowest price of the data and, the last-interval of course includes,
the highest price. Also make sure that overlapping is avoided, so that, no one price falls into two
class-intervals. For example you have class intervals as 0-5, 5-10, 10-15 and so on, then the price
$10 falls in both 5-10 and 10-15. Instead if we use $1 - $5, $6=$10, the class-intervals will be
mutually exclusive.
Class-interval Frequency
$ 1- $ 5 6
$6 - $10 8
$11 - $15 10
$16 - $20 3
$21 - $25 4
Page 16
Total n = fi = 31
Note that each class-interval is of equal width i.e. $5 inclusive. Now we draw the frequency
Histogram as under.
SPSS will generate the histogram based on your selected variable and display it in a new chart
window. The histogram provides a graphical representation of the distribution of the variable's
values, showing the frequency or percentage of each value or value range on the x-axis. You can
further customize the histogram using the chart editor to meet your specific requirements.
Scatter diagram is a graphical method of showing the correlation between the two variables x and
y. The values of each pairs of values of (xi, yi) are plotted on a coordinate plane by choosing a
suitable scale. The diagram of points so obtained is called a scatter diagram.
On a paper draw two axes at right angles one axis corresponding to x and the other to y. For each
of the data, there will correspond a pair of values x,y which in turn will correspond to a point whose
abscissa on the diagram is x and the ordinate is y. The data represented in this way will give a
swarm of points on the diagram. We can interpret the way scatter of cluster as the properties of
relationship between the two variables.
Page 17
To create a scatter diagram (also known as a scatter plot) in SPSS, you can follow these steps:
SPSS will generate the scatter plot based on your selected variables and display it in a new chart
window. The scatter plot shows the relationship between the values of the variables on the x-axis
and y-axis. Each data point represents the intersection of the values of the two variables. You can
further customize the scatter plot using the chart editor to meet your specific requirements.
Example:
500 2500
600 3000
700 12000
800 13000
900 8000
400 4500
850 30000
1000 35000
Page 18
250 1800
350 2350
450 2450
550 2800
650 8000
750 12450
850 11000
950 10000
1100 12500
1200 13000
1300 11750
1400 12000
1500 12500
1600 13750
1700 14000
1800 13600
2000 14200
Page 20
Module – II : Descriptive Statistics and Data Analysis
Measures of Central Tendency – Mean, Median, Mode - Standard deviation, Skewness, Kurtosis -
Correlation – Meaning & Types, Karl Pearson’s co-efficient of correlation, Spearman's Rank
Correlation - Simple Regression Analysis, Multiple Regression Analysis
Measures of central tendency are statistical measures that provide information about the center or
typical value of a dataset. A measure of central tendency or an average is very essential as an
important summary measure in any statistical analysis. An average is a single value which can be
taken as representative of the whole distribution. The most common measures of central tendency
include the mean, median, and mode. Here's a brief explanation of each measure:
Mean: The mean, also known as the average, is calculated by summing up all the values in a dataset
and dividing by the total number of values. It is sensitive to extreme values and provides a measure
of the typical value in a dataset.
Median: The median is the middle value in a dataset when it is arranged in ascending or descending
order. If the dataset has an odd number of values, the median is the middle value. If the dataset has
an even number of values, the median is the average of the two middle values. The median is less
affected by extreme values and is a measure of the central value.
Mode: The mode represents the value(s) that occur most frequently in a dataset. Unlike the mean
and median, the mode can be used with both numerical and categorical variables. A dataset can have
one mode (unimodal), two modes (bimodal), or more modes (multimodal).
These measures provide different perspectives on the center of a dataset and can be used based on
the nature of the data and the research question at hand. It is important to consider the characteristics
and distribution of the dataset when choosing the appropriate measure of central tendency.
2.2 Mean
Arithmetic mean of a set of observations is their sum divided by the number of observations, e.g.,
the arithmetic mean x of n observations is given by:
n
x=
1
(x1 + x2 + .... + xn ) = 1 xi
n n i =1
In case of frequency distribution xi|fi, i=1,2,…..n, where fi is the frequency of the variable xi.
n
f x + f 2 x 2 + .... + f n x n fx i i
1 n
n
x = 1 1
f1 + f 2 + .... + f n
= i =1
= f i xi f i = N
i =1
N
f i
i =1
Page 21
In statistics the collection of all the elements under study is called a POPULATION
whereas a collection of some (but not all) of the elements under study is called a
sample. It is necessary to distinguish whether we are considering a population or
a sample because certain formulas, like those for computing standard deviation
(will be explained later) of a population are different from those for computing the
standard deviation of a sample. Hence population mean is denoted by
Example:
Find the arithmetic mean of the following frequency distribution:
x 1 2 3 4 5 6 7
f: 5 9 12 17 14 10 6
Solution:
Computation of Mean
x f fx
fx
1 5 5 1
x=
2 9 18 N
3 12 36 299
=
4 17 68 73
5 14 70 = 4.0959
6 10 60
7 6 42
Total 73 299
Short-cut Method:
The arithmetic mean can also be calculated by short cut method. This method reduces the amount
of calculation and time. It involves the following steps:
(i) Assume any one value as an assumed mean, which is also known as working mean or arbitrary
average ( A = Assumed mean )
(ii) Find out the difference of each value from the assumed mean ( d = X – A )
(iii) Add all the deviations (difference) (d).
f .d
(iv) Apply the formula : X = A
N
where X = Arithmetic Mean
A = Assumed Mean
fd = Sum of product of frequency and deviation
N = Number of items
Page 22
Note: Any value whether existing in the data or not can be taken as the assumed mean and the final
answer would be the same. The answer is not affected by the value selected as the assumed mean.
However, in order to simplify the calculations, the mid-point of one of the centrally located classes
in the given distribution should be selected as the assumed mean.
x f d (=X - 4) f.d f .d
X = A
1 5 -3 -15 N
2 9 -2 -18
3 12 -1 -12 7
4 17 0 0 = 4+
73
5 14 1 14 = 4 + 0.09
6 10 2 20
7 6 3 18 = 4.0959
Total 73 7
From the following frequency distribution, find out the mean profits:
Solution:
Direct Method:
Mid Point
X f f.m
(m)
100-200 10 150 1500 f .m
X =
N
200-300 18 250 4500
300-400 20 350 7000
72900
400-500 26 450 11700 =
150
500-600 30 550 16500
600-700 28 650 18200
= 486
700-800 18 750 13500
Total 150 72900
Mid Point
X f f .d
(m) d (=X-450) f.d X = A+
N
100-200 10 150 -300 -3000
200-300 18 250 -200 -3600 5400
300-400 20 350 -100 -2000 = 450 +
150
Page 23
= 450 + 36
= 486
400-500 26 450 0 0
500-600 30 550 100 3000
600-700 28 650 200 5600
700-800 18 750 300 5400
Total 150 5400
Mid
X f Point 𝑥 − 450
(m) 𝑑= f.d
100
100-200 10 150 -3 -30
200-300 18 250 -2 -36
300-400 20 350 -1 -20
400-500 26 450 0 0
500-600 30 550 1 30
600-700 28 650 2 56
700-800 18 750 3 54
Total 150 54
∑ 𝑓𝑑 54
𝑀𝑒𝑎𝑛 = 𝐴 + × ℎ = 450 + × 100 = 𝟒𝟖𝟔
𝑁 150
To compute the mean using SPSS, you can follow these steps:
SPSS will calculate the mean based on the formula you provided and create a new variable in your
dataset with the specified target variable name. You can then use this new variable for further
analysis or reporting.
Alternatively, if you only need the mean value for a single variable without creating a new variable,
you can use the "Descriptive Statistics" procedure. Here's how:
Page 24
5. Click the "OK" button to generate the output.
6. In the output viewer window, look for the "Mean" column in the table, which displays the
computed mean for each variable you selected.
Using either of these methods, you can calculate the mean of variables in your SPSS dataset.
2.3 Median
The median, denoted as Md, is a location average. It is the middle value in an ordered array of a set
of observations. For locating median, observations comprising the given data are arranged first in
an array, in a descending or ascending order of magnitude.
If the total number of observations is odd, median is the middle observation in the array. For
example, in an array consisting of seven observations (2,9,10,11,15,17,21), median is the fourth
observation (11) from either side. In general, in the case of sample data consisting of n observations,
n +1
th
If the number of observations is even, median is the mean of the middle two observations in the
array. This holds irrespective of whether the given data pertain to a population or a sample. Had
23 been the 8th observation so as to have even number of observations in the above illustration,
11 + 15
median will be the average of the two middle observations, i.e., = 13 .
2
Computation of median for the grouped data is based on the concept of median class, which is
located by obtaining less than cumulative frequencies. Median class is the one whose
fi f i +1
corresponding cumulative frequency covers when f is an even number and when
2 2
f i +1
f is an odd number. The justification in using for locating the median class when fi is
2
an odd number is to obtain the resultant frequencies in a whole number.
fi
−C
Md =L+ 2 h
fm
where, L is the lower limit of the median class.
C is the cumulative frequency upto the class immediately preceding the median class
fm is the frequency of the median class
h is the width of the median class
Importantly, the method computation of median as above is the same both for sample and
population distributions. The only difference is that fi = N for a population distribution.
The use of above equation requires taking the following steps, and in that order:
i) Find less than cumulative frequencies for each class, and divide the total number of frequencies
( fi) by 2.
Page 25
fi
ii) Locate the class interval whose corresponding less than cumulative frequencies contain
2
f i +1
or , as the case may be. This class is known as the median class.
2
iii) Note the cumulative frequency C up to the class that immediately precedes the median class.
iv) Also note the lower limit L, the class frequency fm, and interval width h, of the median class.
v) Substitute the required in the above to solve for median Md.
Example:
The following table gives the distribution of marks by 500 students in an examination. Obtain
median of the given data.
Solution:
𝑁
−𝐶
𝑀𝑑 = 𝐿 + [ 2 ]×ℎ
𝑓
where, L is the lower limit of the median class.
C is the cumulative frequency upto the class immediately preceding the median class
f is the frequency of the median class
h is the width of the median class
Since the class intervals are inclusive, therefore, it is necessary to convert them into class
boundaries.
Class Intervals Class Boundaries Frequency Less than' type c.f.
0-9 -0.5-9.5 30 30
10-19 9.5-19.5 40 70
20-29 19.5-29.5 50 120
30-39 29.5-39.5 48 168
40-49 39.5-49.5 24 192
Median Class
50-59 49.5-59.5 162 354
60-69 59.5-69.5 132 486
70-79 69.5-79.5 14 500
N
Since = 250 , the median class is 49.5-59.5 and, therefore,
2
L = 49.5; h = 10; fm = 162; c = 192
500
2 − 192
Thus, M d = 49.5 + 10
162
250 − 192
M d = 49.5 + 10
162
M d = 53.08 marks
Page 26
To compute the median using SPSS, you can follow these steps:
SPSS will calculate the median based on the formula you provided and create a new variable in
your dataset with the specified target variable name. You can then use this new variable for further
analysis or reporting.
Alternatively, if you only need the median value for a single variable without creating a new
variable, you can use the "Descriptive Statistics" procedure. Here's how:
2.4 Mode
Mode is the value which occurs most frequently in a set of observations and around which the other
items of the set cluster densely. In other words, mode is the value of the variable which is
predominant in the series. Thus, in the case of discrete frequency distribution, mode is the value of
x corresponding to maximum frequency. For example, in the following frequency distribution:
Page 27
x: 1 2 3 4 5 6 7 8
f: 4 9 16 25 22 15 7 3
f1 − f o
Mo = L + h ;
2 f1 − ( f 0 + f 2 )
Example:
Find the mode for the following distribution:
Class-
0-10 10-20 20-30 30-40 40-50 50-60 60-70 70-80
interval
Frequency 5 8 7 12 28 20 10 10
Solution:
Here maximum frequency is 28. Thus the class 40-50 is the modal class. Using the formula,
f1 − f o
Mo = L + h
2 f1 − ( f 0 + f 2 )
where, L is the lower limit of the modal class.
f1 is the frequency model
f0 is the frequency of the class immediately preceding the modal class
f2 is the frequency of the class immediately succeeding the modal class
h is the width of the modal class
28 − 12
M o = 40 + 10
2 28 − (12 + 20)
M o = 40 + 6.67 = 46.67
28
To compute the mode using SPSS, you can follow these steps:
SPSS will calculate the frequencies for each value of the selected variable and display the
results in the "Output Viewer" window. In the output, you can find a table that includes the
values of the variable and their corresponding frequencies. The mode(s) will be indicated by
the value(s) with the highest frequency.
Please note that if there are multiple values with the same highest frequency, then the variable
may have multiple modes. In this case, the output will list all the modes in the table.
The concept of standard deviation was introduced by Karl Pearson in 1893. Square of standard
deviation is known as variance.
1 2
𝜎 = √𝑁 ∑𝑁
𝑖=1(𝑋𝑖 − 𝑋) , for n individual observations, X1, X2,….Xn
1 2
𝜎 = √𝑁 ∑𝑁
𝑖=1 𝑓𝑖 (𝑋𝑖 − 𝑋) , for a grouped or ungrouped frequency distribution or where an
observation Xi occurs with frequency fi for i = 1,2,….n and fi = N.
It should be noted here that the units of are same as the units of X .
29
(i) Direct Method (ii) Short-cut Method
If there are n observations X1, X2,….Xn, various steps in the calculation of standard
deviation are :
1 n
(i) Find X = X i
n i =1
(ii) ( )
Obtain deviations X i − X for each i = 1,2,….n
(X )
n
1 2
(iii) Square these deviations and add to obtain i −X
n i =1
( )
N 2
1
(iv) Compute variance, i.e., 2 = Xi − X
n i =1
(v) Obtain as the positive square root of 2.
Note: Standard deviation is not affected by change origin, but affected by change of scale.
Example:
A population consists of four observations: {1, 3, 5, 7}. What is the variance and standard
deviation ?
Solution:
First, we need to compute the population for the variance of a population, as shown below:
𝑁 2
1
𝜎 2 = ∑(𝑋𝑖 − 𝑋)
𝑛
𝑖=1
1
𝜎2 = [(1 − 4)2 + (3 − 4)2 + (5 − 4)2 + (7 − 4)2 ]
4
1
𝜎 2 = [(−3)2 + (−1)2 + (1)2 + (3)2 ]
4
1
𝜎 2 = [(9 + 1 + 1 + 9]
4
𝜎2 = 5
𝜎 = √5 = 2.236
Example:
Calculate standard deviation of the following data:
X: 10 11 12 13 14 15 16 17 18
f: 2 7 10 12 15 11 10 6 3
30
Solution:
Let 𝑑 = 𝑋 − 𝑋
X f f.X d = X − 14 d2 f . d2 f . X2
10 2 20 -4 16 32 200
11 7 77 -3 9 63 847
12 10 120 -2 4 40 1440
13 12 156 -1 1 12 2028
14 15 210 0 0 0 2940
15 11 165 1 1 11 2475
16 10 160 2 4 40 2560
17 6 102 3 9 54 1734
18 3 54 4 16 48 972
Total 76 1064 300 15196
1064
X = = 14
76
( )
2
1 N
= Xi − X
2
n i =1
2
1 N
2 = ( X i − 14) = 2 = 300 = 3.95
76 i =1 76
= 1.99
Alternative Method :
2
n
n 2 fi X i
− i =1
fi X i
=2
i =1 N N
2
n
15196 1064
2 =
i =1 76
−
76
= = 1.99
2
𝑓𝑖 𝑑𝑖 2 ∑𝑛
𝑖=1 𝑓𝑖 𝑑𝑖 𝑋𝑖 −𝐴
𝜎 2 = ∑𝑛𝑖=1 −⥂ ( ) × ℎ2 , where 𝑑𝑖 = ,
𝑁 𝑁 ℎ
h is the height of the class interval.
31
𝑛 2
𝑓𝑖 𝑑𝑖 2 ∑𝑛 𝑓𝑖 𝑑𝑖
𝜎 = √∑ −⥂ ( 𝑖=1 ) ×ℎ
𝑁 𝑁
𝑖=1
Example:
Calculate standard deviation of the following series:
Solution:
X f Mid-Values d d2 f.d f . d2
100-105 200 102.5 -5 25 -1000 5000
105-110 210 107.5 -4 16 -840 3360
110-115 230 112.5 -3 9 -690 2070
115-120 320 117.5 -2 4 -640 1280
120-125 350 122.5 -1 1 -350 350
125-130 520 127.5 0 0 0 0
130-135 410 132.5 1 1 410 410
135-140 320 137.5 2 4 640 1280
140-145 280 142.5 3 9 840 2520
145-150 210 147.5 4 16 840 3360
150-155 160 152.5 5 25 800 4000
155-160 90 157.5 6 36 540 3240
Total 3300 550 26870
𝑛 2
𝑓𝑖 𝑑𝑖 2 ∑𝑛 𝑓𝑖 𝑑𝑖
𝜎 = √∑ − ( 𝑖=1 ) ×ℎ
𝑁 𝑁
𝑖=1
32
26870 550
𝜎 = √ 3300 − 3300 × 5 = 𝟏𝟒. 𝟐𝟒
To compute the standard deviation using SPSS, you can follow these steps:
SPSS will calculate the standard deviation for each selected variable and display the results in
the "Output Viewer" window. In the output, you will find a table that includes the variables and
their corresponding statistics, including the standard deviation.
Please note that the standard deviation provides a measure of the dispersion or spread of values
around the mean. It quantifies how much the values deviate from the mean value.
2.6 Skewness
In a symmetrical distribution, the values are evenly distributed around the mean, resulting in a
skewness value of zero. However, in an asymmetric distribution, the values tend to be
concentrated on one side of the mean, causing the distribution to be skewed. Skewness can help
identify whether the tail of the distribution is elongated to the left (negative skewness) or to the
right (positive skewness).
Skewness is often used in conjunction with other descriptive statistics, such as mean and
standard deviation, to gain a more comprehensive understanding of the characteristics of a
33
dataset. It is particularly useful when analyzing financial data, stock returns, and other variables
that may exhibit asymmetric distributions.
𝑴𝒆𝒂𝒏−𝑴𝒐𝒅𝒆
Pearson’s coefficient of skewness = 𝑺𝑫
𝑁
∑ 𝑓𝑑 −𝑐 𝑓 −𝑓
1 0
2
𝑀𝑒𝑎𝑛 = 𝐴 + × ℎ; 𝑀𝑒𝑑𝑖𝑎𝑛 = 𝐿 + × ℎ; 𝑀𝑜𝑑𝑒 = 𝐿 + 2𝑓 −𝑓 ×ℎ
𝑁 𝑓 1 −𝑓
0 2
𝟑(𝑴𝒆𝒂𝒏−𝑴𝒆𝒅𝒊𝒂𝒏)
Pearson’s coefficient of skewness = 𝑺𝑫
𝑄3 +𝑄1 −2𝑄2
Bowley’s coefficient of skewness = 𝑄3 −𝑄1
34
5. Check the "Descriptives" option in the "Statistics" section to include skewness in the
output.
6. Optionally, you can choose additional options such as mean, standard deviation, and other
statistics as per your requirements.
7. Click the "OK" button to generate the output.
SPSS will calculate the skewness for each selected variable and display the results in the
"Output Viewer" window. In the output, you will find a table that includes the variables and
their corresponding statistics, including the skewness.
Skewness measures the asymmetry of the distribution of a variable. A positive skewness value
indicates a longer right tail and a distribution that is skewed to the right, while a negative
skewness value indicates a longer left tail and a distribution that is skewed to the left. A
skewness value of zero indicates a symmetric distribution.
2.7 Kurtosis
Kurtosis is a statistical measure that describes the shape and peakedness of a probability
distribution. It provides information about the tails of the distribution and the presence of
outliers.
Kurtosis measures the degree to which the distribution of a variable deviates from a normal
distribution (also known as the Gaussian distribution or bell curve). A normal distribution has
a kurtosis value of 0.
Positive kurtosis (leptokurtic distribution): A positively kurtotic distribution has heavier tails
and a higher peak compared to a normal distribution. It indicates that the data has more extreme
values or outliers than would be expected in a normal distribution. This means that there is a
higher probability of extreme values occurring.
Negative kurtosis (platykurtic distribution): A negatively kurtotic distribution has lighter tails
and a flatter peak compared to a normal distribution. It indicates that the data has fewer extreme
values or outliers than would be expected in a normal distribution. This means that extreme
values are less likely to occur.
Excess kurtosis: Kurtosis is often reported as excess kurtosis, which is the kurtosis value minus
3. This adjustment allows the normal distribution to have an excess kurtosis value of 0.
The interpretation of kurtosis depends on the context and the specific distribution being
analyzed. High kurtosis does not necessarily imply that the data is problematic or incorrect; it
simply indicates that the distribution has more or fewer extreme values compared to a normal
distribution. It is important to consider the characteristics of the dataset and the specific analysis
being performed when interpreting the kurtosis value.
∑(𝑥−𝜇)
Kurtosis is measured by the coefficient 𝜇1 = =0
𝑛
𝜇4 𝜇4 ∑(𝑥−𝜇)2
𝛾2 = −3 (𝑜𝑟) 𝛽2 = 𝜇2 =
𝜇22 𝜇22 𝑛
35
2 ∑(𝑥−𝜇)3
𝜇2 = 𝜇2′ − 𝜇1′ 𝜇3 = 𝑛
3 ∑(𝑥−𝜇)4
𝜇3 = 𝜇4′ − 3𝜇2′ 𝜇1′ + 2𝜇1′ 𝜇4 =
𝑛
2 3
𝜇4 = 𝜇4′ − 4𝜇3′ 𝜇1′ + 6𝜇2′ 𝜇1′ − 3𝜇1′
Otherwise,
36
SPSS will calculate the kurtosis for each selected variable and display the results in the "Output
Viewer" window. In the output, you will find a table that includes the variables and their
corresponding statistics, including the kurtosis.
Please note that SPSS provides the excess kurtosis, which is the kurtosis value minus 3. This
adjustment allows the normal distribution to have an excess kurtosis value of 0.
2.8 Correlation
Correlation is a statistical measure that quantifies the relationship between two variables. It
indicates the degree to which the variables are related or co-vary with each other. Correlation
measures the strength and direction of the linear association between two variables.
The correlation coefficient, often denoted by the symbol "r," is a numerical value that ranges
between -1 and +1. The sign of the correlation coefficient indicates the direction of the
relationship:
A positive correlation (r > 0) indicates that as one variable increases, the other variable tends
to increase as well. In other words, the variables move in the same direction.
A negative correlation (r < 0) indicates that as one variable increases, the other variable tends
to decrease. In other words, the variables move in opposite directions.
The magnitude or strength of the correlation coefficient indicates the degree of association:
A correlation coefficient close to +1 or -1 indicates a strong relationship. The closer the value
is to +1 or -1, the stronger the linear association between the variables.
A correlation coefficient close to 0 indicates a weak relationship. The closer the value is to 0,
the weaker the linear association between the variables.
It is important to note that correlation measures only the linear relationship between variables
and does not imply causation. Correlation does not determine whether one variable causes
changes in the other, but rather quantifies the strength and direction of their association.
37
Karl Pearson’s Correlation Coefficient
n
x y
1
xy − x y
1 − xy
i i
Cov ( x, y ) n
(x, y) = = n = i =1
Var ( x) .Var ( y ) x y n n
y
1 2 1 2
x i2 − x 2
i −y
n i =1 n i =1
n n n
N
i =1
dxd y − d
i =1
dx
i =1
y
r =
2 2
n
n n
n
N
i =1
d x2
− d x
i =1
N
i =1
d y2 − d y
i =1
38
Example 4.1:
Find the coefficient of correlation between the heights of brothers and sisters from the
following data:
Solution:
n
xy − x y
1
n i =1
Direct Method: r=
n n
y
1 2 1 2
x2 − x 2
−y
n i =1 n i =1
x y x2 y2 xy
65 67 4225 4489 4355
66 68 4356 4624 4488
67 66 4489 4356 4422
68 69 4624 4761 4692
69 72 4761 5184 4968
70 72 4900 5184 5040
71 69 5041 4761 4899
476 483 0 0 28
2.86
r= = 0.6682
2 2.14
Short-cut method:
n n n
N
i =1
dxd y − d
i =1
dx
i =1
y
r =
2 2
n
n n
n
N
i =1
d x2
− d x
i =1
N i =1
d y2
− d y
i =1
39
70 72 2 3 4 9 6
71 69 3 0 9 0 0
476 483 0 0 28 32 20
7 20 − 0 0 140 140
r = = = = 0.6682
7 28 − 0 2 7 32 − 0 2 7 28 7 32 209 .53
SPSS will calculate the correlation coefficients between the selected variables and display the
results in the "Output Viewer" window. In the output, you will find a correlation matrix that
includes the variables and their corresponding correlation coefficients.
The correlation matrix will show the correlation coefficients for each pairwise combination of
the variables. The coefficients will be displayed along with their significance levels, indicating
whether the correlation is statistically significant or not.
You can interpret the correlation coefficients based on their magnitude (close to -1 or +1
indicates a stronger relationship) and sign (positive or negative indicates the direction of the
relationship).
40
Rank the data: Assign ranks to each observation for both variables separately, from lowest to
highest. If there are ties, assign the average rank to tied values.
Calculate the differences: Compute the difference between the ranks for each pair of
observations. These differences are often denoted as d.
Square the differences: Square each difference (d) calculated in the previous step.
Calculate the sum of squared differences: Sum up all the squared differences.
Calculate Spearman's rank correlation coefficient: The formula for calculating Spearman's rho
is given by:
6 ∑ 𝑑2 6 ∑ 𝑑2
𝜌 =1− ( )
𝑜𝑟 1 − 3
𝑛(𝑛 2 − 1) 𝑛 −1
𝑚1 (𝑚12 − 1) 𝑚2 (𝑚22 − 1)
6 (∑ 𝑑 2 + + ) +. . .
12 12
𝜌 =1−[ ]
𝑛(𝑛 2 − 1)
where Σd² represents the sum of squared differences and n is the number of observations.
It's important to note that Spearman's correlation measures the strength and direction of the
monotonic relationship between variables but does not imply causation. It is also less sensitive
to outliers compared to Pearson's correlation, making it a useful measure for non-linear
relationships or ordinal data.
Example:
Two judges in a beauty competition rank the 12 entries as follows.
X : 1 2 3 4 5 6 7 8 9 10 11 12
Y : 12 9 6 10 3 5 4 7 8 2 11 1
Solution:
41
Rank X (Rx) Rank Y (Ry) D (Rx – Ry) D2
1 12 −11 121
2 9 −7 49
3 6 −3 9
4 10 −6 36
5 3 2 4
6 5 1 1
7 4 3 9
8 7 1 1
9 8 1 1
10 2 8 64
11 11 0 0
12 1 11 121
D2 = 416
n
6 d i2
6 416
=1− i =1
= 1− = − 0.4545
n ( n − 1)
2
12 (12 2 − 1)
Example:
For the following data, calculate the coefficient of Rank Correlation.
X : 80 91 99 71 61 81 70 59
Y : 123 135 154 110 105 134 121 106
Solution:
D
X Y Rank X Rank Y D2
(RX - RY)
80 123 5 5 0 0
91 135 7 7 0 0
99 154 8 8 0 0
71 110 4 3 1 1
61 105 2 1 1 1
81 134 6 6 0 0
70 121 3 4 -1 1
59 106 1 2 -1 1
D2 = 4
n
6 d i2
64
=1− i =1
= 1− = 0.9524
n ( n − 1)
2
8 (8 2 − 1)
42
Example:
For the following data, calculate the rank correlation coefficient.
X : 48 33 40 9 16 16 65 24 16 57
Y : 13 13 24 6 15 4 20 9 6 19
Solution:
X Y Rank X Rank Y D D2
48 13 8 5.5 2.5 6.25
33 13 6 5.5 0.5 0.25
40 24 7 10 −3 9.00
9 6 1 2.5 −1.5 2.25
16 15 3 7 −4 16.00
16 4 3 1 2 4.00
65 20 10 9 1 1.00
24 9 5 4 1 1.00
16 6 3 2.5 0.5 0.25
57 19 9 8 1 1.00
D2 = 41
n 2 m1 (m12 − 1) m2 (m22 − 1)
6 d i +
i =1 12
+
12
+ ...
=1−
=
n ( n 2
− 1)
3(3 − 1) 2(2 − 1) 2(2 − 1)
2 2 2
6 41 + + +
12 12 12
= 1− = 0.7333
10 (10 2 − 1)
Regression is used to denote backward tendency which means going back to average or
normal. Regression shows a relationship between the average values of two variables.
43
A line of regression is the line which gives the best estimate of one variable X for any value of
the other variable Y.
Line of regression of X on Y
It is the regression line which gives the best estimate for the values of X for a specified value
of Y.
It is given by
x
X − X = bxy (Y − Y ) (or) X − X = r (Y − Y )
y
where X and Y are means and x and y are standard deviations of X and Y series
respectively.
Line of regression of Y on X
It is the regression line which gives the best estimate for the values of X for a specified value
of Y.
It is given by
Y
Y − Y = bYX ( X − X ) (or) Y −Y = r
(X − X )
X
where X and Y are means and x and y are standard deviations of X and Y series
respectively.
1
∑ 𝑥𝑦−𝑥𝑦
= 𝑛
1 2
∑ 𝑥 2 −𝑥
𝑛
𝜎 𝐶𝑜𝑣.(𝑥,𝑦)
The regression coefficient of x on y is: bxy = 𝑟 𝜎𝑥 = 𝑉𝑎𝑟(𝑦)
; 𝑎 = 𝑥̅ − 𝑏𝑦̅
𝑦
44
1
∑ 𝑥𝑦−𝑥𝑦
= 𝑛
1
∑ 𝑦 2 −𝑦 2
𝑛
1. Launch SPSS: Open SPSS software and load your dataset by going to "File" > "Open" or
by using the provided shortcut.
2. Select variables: Choose the variables you want to include in the regression analysis. The
dependent variable is the variable you want to predict or explain, while independent
variables are the predictors or explanatory variables. You can select variables from the
"Variables View" or by using the "Variable" menu.
3. Run regression analysis: Go to "Analyze" > "Regression" > "Linear" to open the Linear
Regression dialog box.
4. Specify variables: Move the dependent variable to the "Dependent" box and independent
variables to the "Independent(s)" box. You can use the arrow buttons to move variables
between boxes.
5. Options and statistics: In the Linear Regression dialog box, you can specify additional
options and statistics. For example, you can include categorical predictors, set regression
method, and request descriptive statistics or plots.
6. Click "OK": After specifying the required settings, click the "OK" button to run the
regression analysis.
7. Interpret the results: Once the analysis is complete, SPSS will generate output containing
various information, including regression coefficients, standard errors, p-values, R-
squared, and other relevant statistics. These results can help you understand the relationship
between variables and assess the significance and strength of the regression model.
It's important to note that the specific steps and options may vary slightly depending on the
version of SPSS you are using. Additionally, the interpretation of regression results requires
careful consideration of assumptions, significance levels, and contextual understanding of the
data and variables involved.
Multiple regression analysis is a statistical technique used to examine the relationship between
a dependent variable and two or more independent variables. It extends the concept of simple
linear regression, which only considers the influence of a single predictor on the outcome
variable, to account for the combined effects of multiple predictors. It is a statistical technique
used to model the influence of two or more predictors on a single outcome variable. SPSS
(Statistical Package for the Social Sciences) is commonly used to perform multiple regression
analysis.
In multiple regression analysis, the goal is to create a regression model that can predict or
explain the variation in the dependent variable based on the values of the independent variables.
The analysis estimates the regression coefficients, which represent the strength and direction
45
of the relationship between each independent variable and the dependent variable, while taking
into account the effects of other predictors in the model.
Multiple regression analysis estimates the regression coefficients using various methods, such
as ordinary least squares (OLS), which minimizes the sum of squared differences between the
observed and predicted values of the dependent variable. The analysis also provides statistical
measures, such as R-squared, adjusted R-squared, F-test, and p-values, to assess the goodness
of fit and significance of the model and individual predictors.
Multiple regression analysis is widely used in various fields, including social sciences,
economics, finance, psychology, and healthcare, to examine the relationships between
variables and make predictions or informed decisions based on the regression model. It enables
researchers and analysts to understand how different factors jointly contribute to the outcome
of interest and control for the effects of confounding variables.
1. Launch SPSS: Open the SPSS software and load your dataset.
2. Select variables: Choose the dependent variable and the independent variables you want to
include in the analysis. The dependent variable is the variable you want to predict or
explain, while the independent variables are the predictors. You can select variables from
the "Variables View" or using the "Variable" menu.
3. Run the regression analysis: Go to "Analyze" > "Regression" > "Linear" to open the Linear
Regression dialog box.
4. Specify variables: Move the dependent variable to the "Dependent" box and the
independent variables to the "Independent(s)" box. You can use the arrow buttons to move
variables between boxes.
5. Options and statistics: In the Linear Regression dialog box, you can specify additional
options and statistics. For example, you can include categorical predictors, set the
regression method, and request descriptive statistics or plots.
6. Click "OK": After specifying the required settings, click the "OK" button to run the multiple
regression analysis.
46
7. Interpret the results: SPSS will generate output containing various information, such as
regression coefficients, standard errors, p-values, R-squared, and other relevant statistics.
These results help you understand the relationship between variables and assess the
significance and strength of the regression model. Pay attention to the coefficients, as they
represent the estimated effects of the independent variables on the dependent variable,
controlling for other predictors in the model.
Remember that multiple regression analysis assumes certain assumptions, such as linearity,
independence of errors, normality of residuals, and absence of multicollinearity. It is essential
to evaluate these assumptions and interpret the results appropriately. Additionally, consider the
theoretical and practical significance of the variables included in the analysis and the context
of your study when interpreting the results.
47
Module – 3 : Testing of Hypothesis
Parametric – One sample t-test – Two sample independent t-test and Paired t-test – Non-
parametric – One sample KS test – Non-parametric – Mann-Whitney U test – Wilcoxon Signed
Rank test – Kruskal Wallis test – Friedman test – Goodness of fit test – Chi-square test –
Analysis of Variance (ANOVA) – One way and Two-way ANOVA
Parametric tests in statistics are a family of statistical tests that make certain assumptions about
the population distribution from which the data is sampled. These assumptions typically
include:
Parametric tests are widely used when the data satisfy these assumptions, as they offer
advantages such as greater statistical power and more precise estimates compared to non-
parametric tests. Some common parametric tests include:
1. t-test: Used to compare means between two groups. Examples include the independent
samples t-test and paired samples t-test.
2. Analysis of Variance (ANOVA): Used to compare means across three or more groups.
Examples include one-way ANOVA and factorial ANOVA.
3. Pearson's correlation coefficient: Measures the linear relationship between two continuous
variables.
4. Linear regression: Examines the relationship between a dependent variable and one or more
independent variables.
A one-sample t-test is a parametric statistical test used to determine if the mean of a single
sample significantly differs from a hypothesized population mean. It allows you to assess
whether the sample data provides enough evidence to support or reject the null hypothesis.
48
Here is a step-by-step guide on how to conduct a one-sample t-test:
2. Set the significance level (α): Choose a significance level to determine the threshold for
rejecting the null hypothesis. Common values are 0.05 (5%) or 0.01 (1%).
3. Collect and summarize the data: Obtain a single sample of data and calculate the sample
mean (𝑋̅) and sample standard deviation (s).
4. Calculate the test statistic: Compute the one-sample t-test statistic using the formula:
𝑋̅− 𝜇
𝑡= 𝑆⁄
√𝑛
where 𝑋̅ is the sample mean, μ is the hypothesized population mean, S is the sample standard
deviation, and n is the sample size.
5. Determine the critical region: Based on the chosen significance level and the degrees of
freedom (n – 1), find the critical values from the t-distribution table or use statistical software.
6. Compare the test statistic with the critical values: If the test statistic falls within the critical
region, reject the null hypothesis. If it falls outside the critical region, fail to reject the null
hypothesis.
7. Calculate the p-value: Alternatively, you can calculate the p-value associated with the test
statistic. The p-value represents the probability of obtaining a test statistic as extreme as the
one observed, assuming the null hypothesis is true. If the p-value is less than the significance
level (α), reject the null hypothesis.
8. Interpret the results: If the null hypothesis is rejected, you can conclude that there is evidence
to support a significant difference between the sample mean and the hypothesized population
mean. If the null hypothesis is not rejected, you do not have sufficient evidence to conclude a
significant difference.
Remember to consider the assumptions of the one-sample t-test, including a random sample,
independence of observations, normally distributed data, and homogeneous variances.
Violations of these assumptions may affect the validity of the results.
Example
A sample of 900 members has a mean 3.4 cms and standard deviation 2.61 cms. Can the sample
be regarded as one drawn from a population with mean 3.25 cms? Using the level of
significance as 0.05, is the claim acceptable?
Solution:
Here n = 900, hence it is a large sample.
49
Given = 3.25; x = 3.40; s = 2.61
Step 5: Inference:
Since the calculated value of Z (1.72) is less than the critical value (1.96), do not
reject the null hypothesis. Hence, we may conclude that the sample has been drawn
from a population with mean 3.25 cms.
Example
A random sample of 100 members gave a mean weight of 58 kilogram with standard deviation
of 4 kg. Test the hypothesis that the mean weight in the population is 60 kg. at 1% level.
Solution:
Here n = 100, hence it is a large sample.
Given = 60; x = 58; s = 4
x− 58 − 60
Step 3: Test statistic Z = = = − 5; Z =5
s 4
n 100
Step 5: Inference:
Since the calculated value of Z (5) is greater than the critical value (2.58), reject the
null hypothesis. Hence we may conclude that the mean weight of the population is
not 60 kgs.
Example
The mean I.Q. of a sample of 1600 children was 99. Is it likely that this was a random sample
from a population with mean I.Q. 100 and standard deviation 15?
Solution:
Here n = 1600, hence it is a large sample.
Given = 100; x = 99; = 15
50
Step 1: Null Hypothesis H0: = 60
Alternative Hypothesis H1: 60 (Two-sided test)
x− 99 − 100
Step 3: Test statistic Z = = = − 2.67; Z = 2.67
15
n 1600
Step 5: Inference:
Since the calculated value of Z (2.67) is greater than the critical value (1.96), reject
the null hypothesis. Hence we may conclude that the sample has not been drawn
from a population with mean 100 and standard deviation 15.
Example
A new variety of potato grown in 250 plots gave rise to a mean yield of 82.7 quintals per hectare
with a standard deviation of 14.6 quintals per hectare. Is it reasonable to assert that the new
variety is superior in yield to the standard variety with an established yield of 80.2 quintals per
hectare?
Solution:
Here n = 250, hence it is a large sample.
Given = 80.2; x = 82.7; s = 14.6
Step 5: Inference:
Since the calculated value of | Z | (2.71) is greater than the critical value (1.645),
reject the null hypothesis. Hence we may conclude that the new variety is superior
in yield to the standard variety.
A sample is said to be a small sample, if the size of the sample is less than 30, i.e., n < 30. We
know that the mean of small samples conforms to the t-values contained in the t-distribution.
51
We shall use t-statistic. The t-values for different degrees of freedom and for different values
of , the level of significance are given in the Statistical Table for given probability levels in
all statistics books. The nature of the t-statistic used for the different tests of significance is as
follows:
S
Standard Error of Mean : S.E. ( x ) =
n
(x )
2
i −x
where S = sample standard deviation = i
n −1
x−
Test statistic t = t distribution with n − 1 degrees of freedom ;
S
n
where x = sample mean; = population mean; n= sample size
Example
A soap manufacturing company was distributing a particular brand of soap through a large
number of retail shops. Before a heavy advertisement campaign, the mean sales per shop was
140 dozens. After the campaign a sample of 26 shops was taken and the mean sales figure was
found to be 147 dozens with standard deviation of 16. Can you consider the advertisement
effective at 5% level of significance?
Solution:
Here n = 26, hence it is a small sample.
Given = 140; x = 147; S = 16
Step 5: Inference:
Since the calculated value of t (2.23) is greater than the critical value (1.708), reject
the null hypothesis. Hence we may conclude that the advertisement is effective.
52
Example
A company claims that the average breaking strength of steel rods is 18.5 thousand pounds. To
test this, 14 rods were tested. The mean and standard deviation obtained were 17.85 and 1.958
respectively. At 5% level of significance, can it be concluded that the company’s claim is
correct?
Step 5: Since the calculated value of | t | (1.24) is less than the critical value (1.771), do not
reject the null hypothesis. Hence we may conclude that the claim of the company is
correct.
Example
In 16 one hour test runs, the gasoline consumption of a heavy duty engine averaged 16.4 gallons
with a standard deviation of 2.1 gallons. Test the claim that the average gasoline consumption
of this engine is 12.0 gallons per hour.
Solution:
Here n = 16, hence it is a small sample.
Given = 12; x = 16.4; S = 2.1
Step 1: Null Hypothesis H0: = 12 (The average gasoline consumption is 12 gallons / hour)
Alternative Hypothesis H1: 12 (The average gasoline consumption is not 12
gallons / hour) (Two-sided test)
Step 5: Inference: Since the calculated value of t (8.38) is greater than the critical value
(2.13), reject the null hypothesis. Hence the null hypothesis is rejected and conclude
that the average gasoline consumption is not 12 gallons / hour.
53
Example
Ten objects are chosen at random from a large population and their weights are found to be in
gms 63, 63, 64, 65, 66, 69, 69, 70, 70, 71. In the light of the above data, discuss the suggestion
that the mean weight in the universe is 65 gms.
Solution:
Here n = 10, hence it is a small sample.
Given = 65; To find x and S from the sample data.
x d = x − 66 d2
63 −3 9
63 −3 9
64 −2 4
65 −1 1
66 0 0
69 3 9
69 3 9
70 4 16
70 4 16
71 5 25
Total 10 98
1 n 2 d
2
.d 10 1 100
x = A = 66 + = 67 ; S = d − = 98 − 10 = 3.127
n 10 n − 1 i =1 n 9
x− 67 − 65
Step 3: Test statistic t = = = 2.02;
S 3.127
n 10
Step 4: Critical value t9,0.05 = 2.262
Step 5: Inference:
Since the calculated value of t (2.02) is less than the critical value (2.262), do not
reject the null hypothesis. Hence, we may conclude that the mean weight of universe
is 65 gms.
54
2. Go to "Analyze" > "Compare Means" > "One-Sample T Test" to open the One-Sample T
Test dialog box.
3. In the One-Sample T Test dialog box, select the variable you want to test from the left
column and move it to the "Test Variable(s)" box on the right using the arrow button.
4. Enter the hypothesized population mean under "Test Value." This value represents the mean
you want to compare the sample mean against.
5. Optionally, you can specify additional settings such as confidence intervals, grouping
variables, and graphical options.
7. SPSS will generate output that includes various statistics and results related to the one-
sample t-test. The key information to look for is the t-value, degrees of freedom, p-value,
and confidence intervals.
9. Degrees of freedom indicate the number of independent pieces of information available for
the analysis.
10. The p-value is the probability of obtaining a test statistic as extreme as the observed,
assuming the null hypothesis is true.
11. Confidence intervals provide a range of plausible values for the population mean.
12. Interpret the results based on the obtained statistics, including the t-value, p-value, and
confidence intervals. If the p-value is less than the chosen significance level (α), you can
reject or fail to reject the null hypothesis.
Remember to consider the assumptions of the one-sample t-test, such as the normality of the
data, independence of observations, and homogeneity of variances. If these assumptions are
violated, the results may be less reliable.
Let A and B be two populations with means 1 and 2 and variances 12 and 22 respectively.
Let us take two independent samples of size n1 and n2 from these two populations. Let
x1 and x 2 be the corresponding sample means. Then our problem is
(i) To test the equality of two population means, i.e. to test whether 1 = 2
(ii) To test the significance of the difference between two independent sample means,
viz. x1 − x 2 .
55
The following steps should be taken for testing the significance difference between two means.
1. Null Hypothesis. The null hypothesis is set in any one of the following forms.
H0 : µ1 = µ2, i.e., the two samples have been drawn from different populations having
the same means and equal standard deviation or, H0 : x1 = x 2 , i.e., the two samples
have been drawn from the same parent population.
Case II. When the population standard deviations 1 and 2 are not known.
In this case we are given sample standard deviations S1 and S2 and we
calculate the Standard Error of difference of means by the following
formula.
S12 S 22
Standard Error of Difference of Means: S.E.( x1 − x 2 ) = +
n1 n2
x1 − x 2
Test statistic : Z =
S12 S2
+ 2
n1 n2
The other steps are same as those given for testing the significance of a single mean.
Example
The mean yield of wheat from a district A was 210 kgs. with standard deviation 10 kgs. per
acre from a sample of 100 plots. In another district B, the mean yield was 220 kg. with standard
deviation 12 kgs. per acre from a sample of 150 plots. Assuming that the standard deviation of
the yield in the entire state was 11 kg., test whether there is any significant difference between
the yield of crops in the two cities.
Solution:
We have the following data.
n1 = 100; x1 = 210 ; S1 = 10 ; = 11
56
n2 = 150; x 2 = 220 ; S2 = 12 ;
Step 1: Null Hypothesis H0: µ1 = µ2, i.e., there is no significant difference between the mean
yield of crops in two districts.
Alternative Hypothesis. H1 : µ1 ≠ µ2 (Two-tailed test)
x1 − x 2 210 − 220
Step 3: Test statistic : Z = = = − 7.04
12 22 112 112
+ +
n1 n2 100 150
Step 4: Critical value Z0.05 = 1.96
Step 5: Inference:
Since the calculated value of | Z | (7.04) is greater than the critical value (1.96), reject
the null hypothesis. Hence we may conclude that there is significant difference
between the mean yield of crops in two districts.
Example
In order to make a survey of the buying habits, two markets A and B are chosen at two different
parts of a city. 400 women shoppers are chosen at random in market A. Their average daily
expenditure on food is found to be Rs.250 with a standard deviation of Rs.40. The figures are
Rs.220 and Rs.55 respectively in the market B, where also 400 women shoppers are chosen at
random. Test at 1% level of significance whether the average daily food expenditures of the
two populations of shoppers are equal.
Solution:
We have the following data.
n1 = 400; x1 = 250 ; S1 = 40 ;
n2 = 400; x 2 = 220 ; S2 = 55 ;
Step 1: Null Hypothesis H0: µ1 = µ2, i.e., the average daily food expenditures of the two
populations of shoppers are equal.
Alternative Hypothesis. H1 : µ1 ≠ µ2 (Two-tailed test)
Step 5: Inference:
57
Since the calculated value of | Z | (8.82) is greater than the critical value (2.58), reject
the null hypothesis. Hence we may conclude that the average daily food
expenditures of the two populations of shoppers are not equal.
The following steps should be taken for testing the significance difference between two means.
1. Null Hypothesis. The null hypothesis is set in any one of the following forms.
H0 : µ1 = µ2, i.e., the two samples have been drawn from different populations having
the same means and equal standard deviation or, H0 : x1 = x 2 , i.e., the two samples
have been drawn from the same parent population.
Test statistic :
x1 − x 2
t= t distribution with n1+n2 −2 d.f.
1 1
S +
n1 n2
The other steps are same as those given for testing the significance of a single mean.
Example
The average number of articles produced by two machines per day are 200 and 250 with
standard deviations 20 and 25 respectively on the basis of records of 25 days production. Can
you regard both the machines equally efficient at 1% level of significance?
Step 1: Null Hypothesis H0: µ1 = µ2, i.e., both the machines are equally efficient.
Alternative Hypothesis. H1 : µ1 ≠ µ2 (Two-tailed test)
58
Step 2: Level of significance = 0.01
x1 − x 2
Step 3: Test statistic : t = t distribution with 48 d.f.
1 1
S +
n1 n2
200 − 250 − 50
t = = = − 7.81
1 1 6.40
22.64 +
25 25
Step 4: Critical value t48, 0.01 = 2.66
Step 5: Inference:
Since the calculated value of | t | (7.81) is greater than the critical value (2.66), reject
the null hypothesis. Hence we may conclude that the machines are equally efficient
at 1% level of significance.
Example
Two types of batteries are tested for their lengths of life and the following data are obtained.
Solution:
Step 1: Null Hypothesis H0: µ1 = µ2, i.e., there is no significant difference in the two means.
Alternative Hypothesis. H1 : µ1 ≠ µ2 (Two-tailed test)
x1 − x 2
Step 3: Test statistic : t = t distribution with 15 d.f.
1 1
S +
n1 n2
59
(n1 − 1) S12 + (n2 − 1) S 22 8112 + 7 12 2
S = = = 11.48
n1 + n2 − 2 9+8− 2
700 − 640 − 60
t = = = − 7.17
1 1 5.58
11.48 +
9 8
Step 4: Critical value t15, 0.05 = 2.131
Step 5: Inference:
Since the calculated value of | t | (7.17) is greater than the critical value (2.131), reject
the null hypothesis. Hence, we may conclude that there is significant difference in
the two means at 5% level of significance.
Example
The following data shows the cost in hundred rupees per square metre of the floor area
concerning randomly selected 7 schools and 5 office blocks from those completed during the
period 1997 to 2002.
Schools : 28 31 26 27 23 38 37
Office blocks : 37 42 34 37 35
Do the data support the hypothesis that the cost per square metre for the office blocks was
greater than that for the schools? Test at 5% level of significance.
Solution:
# X X −X (X − X ) 2
# Y Y −Y (Y − Y ) 2
1 28 12 4 1 37 0 0
2 31 1 1 2 42 5 25
3 26 -4 16 3 34 -3 9
4 27 -3 9 4 37 0 0
5 23 -7 49 5 35 -2 4
6 38 8 64 Total 37 38
7 37 7 49
Total 210 192
X=
X = 210 = 30 Y=
Y = 185 = 37
n1 7 n2 5
(X − X ) (Y − Y )
2 2
192 38
S1 = = = 5.66 S2 = = = 3.08
n1 −1 7 n2 −1 5
60
Step 1: Null Hypothesis H0: µ1 = µ2, i.e., there is no significant difference in the cost per
square metre for the office block and school blocks.
Alternative Hypothesis. H1 : µ2 > µ1 (One-tailed test)
i.e., the cost per square metre for the office block is greater than that of school blocks.
x1 − x 2
Step 3: Test statistic : t = t distribution with 10 d.f.
1 1
S +
n1 n2
30 − 37 −7
t = = = − 2.49
1 1 2.81
4.8 +
7 5
Step 4: Critical value t10, 0.05 = 1.812
Step 5: Inference:
Since the calculated value of | t | (2.49) is greater than the critical value (1.812), reject
the null hypothesis. Hence we may conclude that there is significant difference in
the cost per square metre for the office blocks and school blocks at 5% level of
significance.
Example
The number of ATM transactions in a month by young customers (under 25 years) and
customers over 60 years are tabulated below. At 0.01 significance level, can we conclude that
young customers use the ATMs more?
Under 25 10 10 11 15 7 11 10 9
Over 60 4 8 7 7 4 2 1 7 4 10 5
Solution:
# X X −X (X − X ) 2
# Y Y −Y (Y − Y ) 2
61
5 7 -3.375 11.391 5 4 -1.364 1.860
6 11 0.625 0.391 6 2 -3.364 11.314
7 10 -0.375 0.141 7 1 -4.364 19.041
8 9 -1.375 1.891 8 7 1.636 2.678
Total 83 35.875 9 4 -1.364 1.860
10 10 4.636 21.496
11 5 -0.364 0.132
Total 59 72.545
X=
X = 83 = 10.375 Y=
Y = 59 = 5.364
n1 8 n2 11
(X − X )
2
35.875
S1 = = = 2.264
n 1 −1 7
(Y − Y )
2
72.545
S2 = = = 2.693
n 2 −1 10
Step 1: Null Hypothesis H0: µ1 = µ2, i.e., usage of ATM by young and old customers are
same.
Alternative Hypothesis. H1 : µ1 > µ2 (One-tailed test)
i.e., young customers use the ATMs more.
x1 − x 2
Step 3: Test statistic : t = t distribution with 17 d.f.
1 1
S +
n1 n2
(n1 − 1) S12 + (n2 − 1) S 22 7 2.264 2 + 10 2.693 2
S = = = 2.666
n1 + n2 − 2 8 + 11 − 2
62
(i) the sizes of the samples are equal, i.e., n1 = n2 = n.
(ii) the samples are not independent, and the sample observations (x1, x2, … xn) and (y1, y2,
… yn) are dependent in pairs. In other words, the pairs of observation (x1,y1), (x2, y2) ,
(xn, yn) etc. correspond to 1st, 2nd, …. nth unit respectively. Although we may find two
sets of sample values corresponding to two observations (x1, x2, … xn) and (y1, y2, … yn)
for the sample elementary unit under different situation, the tests discussed earlier are
not applicable, and we proceed as follows:
Step 1: Let D = (xi − yi), i = 1,2,3…n denote the difference in observations for the unit.
Step 2: Calculate D =
D
n
(D − D)
2
Step 3: Calculate S =
n −1
(D − D)
2
where S =
n −1
The other steps are same as those given for testing the significance of a single mean.
Example
Ten students were given intensive coaching for a month in Statistics. The scores obtained in
tests 1 and 5 are given below:
[Link]. of student 1 2 3 4 5 6 7 8 9 10
Marks in 1st test: 50 52 53 60 65 67 48 69 72 80
Marks in 5th test: 65 55 65 65 60 67 49 82 74 86
Does the score from test 1 to test 5 show an improvement? Test at 5% level of significance.
Solution:
Computation of D and S.
63
# X Y D=X–Y D−D (D − D) 2
D=
D =
− 52
= − 5 .2
n 10
(D − D)
2
367.6
S= = = 6.39
n −1 9
Step 1: Null Hypothesis H0: µ1 = µ2, i.e., there is no improvement after coaching.
Alternative Hypothesis. H1 : µ2 > µ1 (One-tailed test)
i.e., there is improvement after coaching.
D
Step 3: Test statistic : t = t distribution with n−1 d.f.
S
n
− 5.2
t = = − 2.57
6.39
10
Step 4: Critical value t9, 0.05 = 1.833
Step 5: Inference:
Since the calculated value of | t | (2.57) is greater than the critical value (1.833), reject
the null hypothesis. Hence we may conclude that there is improvement in standard
after coaching.
Example
A new cell phone battery is being considered as a replacement for the current one. Ten college
student cell phone users are selected to try each battery in their usual mix of “talk” and
“standby” and to record the number of hours until recharge was needed.
Student No. : 1 2 3 4 5 6 7 8 9 10
64
New battery : 45 41 53 40 53 43 49 39 41 43
Old battery : 52 34 40 38 38 44 37 45 28 33
Do these results show that new battery has significantly longer life at = 0.05?
Solution:
Computation of D and S.
# X Y D=X–Y D−D (D − D)
2
1 45 52 -7 -12.8 163.84
2 41 34 7 1.2 1.44
3 53 40 13 7.2 51.84
4 40 38 2 -3.8 14.44
5 53 38 15 9.2 84.64
6 43 44 -1 -6.8 46.24
7 49 37 12 6.2 38.44
8 39 45 -6 -11.8 139.24
9 41 28 13 7.2 51.84
10 43 33 10 4.2 17.64
Total 447 389 58 609.60
D=
D = 5.8 = 5.8
n 10
(D − D)
2
609 .6
S= = = 8.23
n −1 9
Step 1: Null Hypothesis H0: µ1 = µ2, i.e., the life of old and new batteries are same.
Alternative Hypothesis. H1 : µ2 > µ1 (One-tailed test)
i.e., the new battery has significantly longer life than old battery.
D
Step 3: Test statistic : t = t distribution with n−1 d.f.
S
n
5.8
t = = 2.23
8.23
10
Step 5: Inference:
Since the calculated value of | t | (2.23) is greater than the critical value (1.833), reject
the null hypothesis. Hence, we may conclude that the new battery has significantly
longer life.
65
To conduct a paired sample t-test in SPSS, you can follow these steps:
2. Go to "Analyze" in the top menu and select "Compare Means" and then "Paired-Samples
T Test."
3. In the "Paired-Samples T Test" dialog box, select the variables you want to analyse from
the list on the left and move them to the box on the right using the arrow button.
4. Check the box for "Paired Differences" if you want to include the calculated difference
between the paired variables in the output.
SPSS will generate the output that includes descriptive statistics, t-test results, and the
significance level (p-value) for the paired sample t-test. The output will provide information
about the mean difference between the paired variables, the standard deviation, the t-value,
degrees of freedom, and the p-value indicating the significance of the test.
It's important to ensure that your data meets the assumptions of the paired sample t-test,
including the assumption of normality and the assumption that the differences between the
paired observations are approximately normally distributed.
Non-parametric tests are statistical tests that do not make assumptions about the underlying
distribution of the data, unlike parametric tests. These tests are useful when the data do not
meet the assumptions required for parametric tests or when dealing with ordinal or categorical
variables. Some commonly used non-parametric tests include:
2. Wilcoxon signed-rank test: This test is used to compare two related groups or conditions,
such as pre-test and post-test measurements from the same individuals. It assesses whether
there is a significant difference in the medians of the paired observations.
4. Friedman test: This test is an extension of the Wilcoxon signed-rank test and is used to
compare three or more related groups or conditions. It assesses whether there are significant
differences in the medians among the related groups.
66
5. Chi-square test: It is used to examine the association between categorical variables. It
compares the observed frequencies in different categories to the expected frequencies under
the assumption of independence.
6. Fisher's exact test: This test is used when the sample sizes are small, and the assumptions
of the chi-square test are not met. It examines the association between categorical variables
in a 2x2 contingency table.
These non-parametric tests provide valuable alternatives when the assumptions of parametric
tests are not met or when dealing with non-normally distributed or categorical data. The choice
of test depends on the research question, the nature of the data, and the specific hypotheses
being tested.
The Mann-Whitney U test, also known as the Mann-Whitney-Wilcoxon test or Wilcoxon rank-
sum test, is a non-parametric statistical test used to determine if there is a significant difference
between two independent groups or conditions. It is commonly used when the data do not meet
the assumptions required for parametric tests, such as the t-test.
The Mann-Whitney U test compares the ranks of observations between two groups to assess
whether the distributions of the two groups differ significantly. It does not assume any specific
distribution for the data and is based on the rank order of the values.
Define the null hypothesis (H0) and the alternative hypothesis (H1):
H0: There is no significant difference between the distributions of the two groups.
H1: There is a significant difference between the distributions of the two groups.
Rank all the observations from both groups together, from the smallest to the largest value.
The critical value can be looked up in the Mann-Whitney U table for a given significance level
(e.g., 0.05).
The p-value can be calculated based on the U statistic and sample sizes using statistical
software.
Compare the obtained U statistic to the critical value or evaluate the p-value:
67
If the obtained U statistic is smaller than the critical value or the p-value is less than the chosen
significance level (e.g., 0.05), reject the null hypothesis and conclude that there is a significant
difference between the two groups.
If the obtained U statistic is greater than the critical value or the p-value is greater than the
significance level, fail to reject the null hypothesis and conclude that there is not enough
evidence to suggest a significant difference between the two groups.
The Mann-Whitney U test provides a way to assess the difference between two independent
groups without making assumptions about the underlying distribution. It is commonly used in
research studies, particularly when dealing with ordinal or skewed data or when parametric
assumptions are violated.
To apply the test, we first consider the samples comprising 1 and 2 observations. The two sets
of data are then combined into one group of n (where n= 1 + 2) observations and we rank the
values from 1 to n in the ascending order so that the smallest value is assigned rank 1 and the
largest one is assigned rank n.
After this, obtain the sum of the ranks of values for samples 1 and 2 as T1 and T2
respectively.
With these inputs, we calculate a U statistic for T1 and T2 as follows:
n1 (n1 + 1) n (n + 1)
U1 = n1 n2 + − R1 and U 2 = n1 n2 + 2 2 − R2
2 2
𝑛1 × 𝑛2 (𝑛1 + 𝑛2 + 1)
𝜎𝑈 = √
12
With these inputs, we may compute z-values and take the appropriate accept/reject decisions
The test may be one-tailed or two-tailed.
Working Method
Step 1: Set the null hypothesis H0 and alternative hypothesis H1: 1 = 2 , 1 2
( two tail test).
Step 2: Combine all sample values in an array from smallest to the largest, and assign
ranks to all these values. If two are more sample values are identical, the
sample values are each assigned a rank equal to the mean of the ranks that
would otherwise be assigned.
68
Step 3: Find the same of the ranks for each of the samples. Let us denote these sums
by R1 and R2. Also, n1and n2 and their respective samples sizes. For
convenience, choose n1 as the smaller size if they are unequal so that n1 n2 .
A significant difference the rank sums R1 and R2, implies a significant
difference between the samples.
Step 4: Calculation of U to test the difference between the rank sums:
𝑛1 (𝑛1 +1)
U Statistic: For sample 1 𝑈1 = 𝑛1 × 𝑛2 + − 𝑅1
2
and
𝑛2 (𝑛2 +1)
𝑈2 = 𝑛1 × 𝑛2 + − 𝑅2
2
For sample 2
If n1 and n2 are both at least equal to 8, it turns out that the distribution of U is
nearly normal and one could use the statistic Z, where
𝑈−𝜇𝑈
𝑍= 𝜎𝑈
Example:
The nicotine contents of two branches of cigarettes, measured in milligrams, was found to be
as follows.
Solution:
Step 1: Set the null hypothesis:
Null hypothesis: H0: 𝜇1 = 𝜇2 is the average contents of the two brands are equal.
Alternative hypothesis:H1: 𝜇1 ≠ 𝜇2 is the average contents of the two brands are not
equal.
Step 2: Level of significance : = 0.05.
Step 3: Computation of Z statistic
69
The observations are arranged in ascending order and rank from 1 to 18 are assigned.
Data 0.6 1.6 1.9 2.1 2.2 2.5 3.1 3.3 3.7 4.0 4.0 4.1 4.8 5.4 5.4 6.1 6.2 6.3
Ran 1 2 3 4 5 6 7 8 9 10. 10. 12 13 14. 14. 16 17 18
k 5 5 5 5
The ranks of the observation belonging to the small samples are under scored.
R1 = Rank of Brand A = 93
R2 = Rank of Brand B = 78
𝑛1 (𝑛1 + 1) 8(8 + 1)
𝑈1 = 𝑛1 × 𝑛2 + − 𝑅1 = 8 × 10 + − 93 = 23
2 2
𝑛2 (𝑛2 + 1) 10(10 + 1)
𝑈2 = 𝑛1 × 𝑛2 + − 𝑅2 = 8 × 10 + − 78 = 57
2 2
U = Min (U1, U2) = 23
𝑛1 × 𝑛2 8 × 10
𝜇𝑈 = = = 40
2 2
𝑛1 𝑛2 (𝑛1 + 𝑛2 + 1) 8 × 10 × (8 + 10 + 1)
𝜎𝑈 = √ =√ = 11.255
12 12
𝑈−𝜇𝑈 23−40
Computation of Z: 𝑍 = = = −1.51
𝜎𝑈 11.255
Step 5: Interpretation: Since the calculated value of | Z | is less than the critical value, we do
not reject the null hypothesis and conclude that the average contents of the two brands are
equal.
Example:
The values in one sample are 53,38,69,54,46,39,73,48,73,74,60 and 78. In the other sample
they are 44,40,61,52,32,44,70,41,67,72,53 and 72. Test at the 10% level the hypothesis that
they come from populations with same mean. Apply U-test.
Solution:
First of all we assign ranks to all observations, adopting low to high ranking process on the
presumption that all given items belong to the single sample.
70
44 6.5 B
46 8 A
48 9 A
52 10 B
53 11.5 B
53 11.5 A
57 13 A
60 14 A
61 15 B
67 16 B
69 17 A
70 18 B
72 19.5 B
72 19.5 B
73 21.5 A
73 21.5 A
74 23 A
78 24 A
From the table we find that sum of ranks assigned to sample first items or R1
R1 = 2 + 3 + 8 + 9 + 11.5 + 13 + 14 + 17 + 21.5 + 21.5 + 23 + 24 = 167.5
And similarly, we find the sum of ranks assigned to sample second item or R2
R2 = 1 + 4 + 5 + 6.5 + 6.5 + 10 + 11.5 + 15 + 16 + 18 + 19.5 + 19.5 = 132.5
And we have n1 = 12 and n2 = 12.
𝑛1 (𝑛1 + 1) 12(12 + 1)
𝑈1 = 𝑛1 × 𝑛2 + − 𝑅1 = 12 × 12 − 167.5 = 54.5
2 2
𝑛2 (𝑛2 + 1) 12 × (12 + 1)
𝑈2 = 𝑛1 𝑛2 + − 𝑅2 = 12 × 12 + − 132.5 = 89.5
2 2
Min (U1, U2) = 54.5
𝑛1 × 𝑛2 12 × 12
𝜇𝑈 = = = 72
2 2
𝑛1 × 𝑛2 (𝑛1 + 𝑛2 + 1) 12 × 12(12 + 12 + 1)
𝜎𝑈 = √ =√ = 17.32
12 12
71
𝑈 − 𝜇𝑈 54.5 − 72
𝑍= = = −1.01
𝜎𝑈 17.32
Step 5: Interpretation: Since the calculated value of | Z | is less than the critical value, we do
not reject the null hypothesis and conclude that the two samples have come from the same
population.
2. Go to "Analyze" in the top menu and select "Nonparametric Tests" and then "Legacy
Dialogs" and "2 Independent Samples."
3. In the "2 Independent Samples" dialog box, select the variable representing the dependent
variable (the variable you want to compare between groups) and move it to the "Test
Variable(s)" box.
4. Select the variable representing the grouping variable (the variable that defines the groups
you want to compare) and move it to the "Grouping Variable" box.
SPSS will generate the output that includes the test statistics, U value, significance level (p-
value), and descriptive statistics for each group. The Mann-Whitney U test compares the ranks
of the values between the two groups to determine whether there is a significant difference in
the distributions.
If the p-value is less than the chosen significance level (e.g., 0.05), it indicates a significant
difference between the two groups.
If the p-value is greater than the significance level, it suggests that there is not enough evidence
to conclude a significant difference between the groups.
It's important to note that the Mann-Whitney U test assesses differences in the distributions but
does not provide information about the direction or magnitude of the differences.
The Wilcoxon signed-rank test is a non-parametric statistical test used to determine if there is
a significant difference between paired observations or within-subject measurements. It is
commonly used when the data do not meet the assumptions required for parametric tests, such
as the paired t-test.
72
The Wilcoxon signed-rank test assesses whether the medians of the paired differences between
two related groups or conditions are significantly different from zero. It does not assume any
specific distribution for the data and is based on the rank order of the absolute differences
between paired observations.
1. Define the null hypothesis (H0) and the alternative hypothesis (H1):
H0: There is no significant difference between the medians of the paired differences.
H1: There is a significant difference between the medians of the paired differences.
2. Calculate the differences between paired observations (or calculate the signed ranks of the
absolute differences).
3. Rank the absolute differences from smallest to largest, assigning ranks based on their
magnitudes.
4. Calculate the sum of the positive ranks (W+) and the sum of the negative ranks (W-)
separately.
• The critical value can be looked up in the Wilcoxon signed-rank table for a given sample
size and significance level (e.g., 0.05).
• The p-value can be calculated based on the signed ranks and the sample size using
statistical software.
• If the obtained test statistic is smaller than the critical value or the p-value is less than
the chosen significance level (e.g., 0.05), reject the null hypothesis and conclude that
there is a significant difference between the paired observations.
• If the obtained test statistic is greater than the critical value or the p-value is greater
than the significance level, fail to reject the null hypothesis and conclude that there is
not enough evidence to suggest a significant difference between the paired
observations.
The Wilcoxon signed-rank test provides a way to compare paired observations or within-
subject measurements without assuming a specific distribution. It is often used in research
studies, particularly when dealing with ordinal or skewed data, or when parametric assumptions
are violated.
73
Wilcoxon test Worked Example: In order to investigate whether adults report verbally
presented material more accurately from their right than from their left ear, a dichotic listening
task was carried out. The data were found to be positively skewed.
STEP ONE:
Null hypothesis: There is no difference between the number of words recalled from the right
ear and the number of words recalled from the left ear.
74
STEP TWO:
Ignoring the sign of the difference (whether it's positive or negative), the lowest difference is –
1, of which there are 4 instances. So, we add up the ranks they would take e.g., 1 + 2 + 3 + 4 =
10, and then divide this by the number of ranks, so 10 / 4 = 2.5.
The next lowest rank is 2 (there are both positive and negative differences here, but ignore the
signs). So, add together ranks 5 + 6 = 11. The ranks assigned would therefore actually be 11 /
2 = 5.5.
STEP THREE:
Add together the ranks belonging to scores with a positive sign: 5.5 + 7.5 = 13
STEP FOUR:
75
STEP FIVE:
STEP SIX:
STEP SEVEN:
With the Wilcoxon test, an obtained W is significant if it is LESS than the critical value.
Obtained W = 13
Critical value = 11
Our obtained value of 13 is more than 13, we reject the null hypothesis, and so we can conclude
that there is a difference between the number of words recalled from the right ear and the
number of words recalled from the left ear.
76
Example:
A study is run to evaluate the effectiveness of an exercise program in reducing systolic blood
pressure in patients with pre-hypertension (defined as a systolic blood pressure between 120-
139 mmHg or a diastolic blood pressure between 80-89 mmHg). A total of 15 patients with
pre-hypertension enroll in the study, and their systolic blood pressures are measured. Each
patient then participates in an exercise training program where they learn proper techniques
and execution of a series of exercises. Patients are instructed to do the exercise program 3 times
per week for 6 weeks. After 6 weeks, systolic blood pressures are again measured. The data are
shown below.
Is there is a difference in systolic blood pressures after participating in the exercise program as
compared to before?
Solution:
The test statistic for the Wilcoxon Signed Rank Test is W, defined as the smaller of W+ and W-
which are the sums of the positive and negative ranks, respectively.
The critical value for this two-sided test with n=15 and α=0.05 is 25 and the decision rule is as
follows: Reject H0 if W < 25.
77
Because the before and after systolic blood pressures measures are paired, we compute
difference scores for each patient.
The next step is to rank the ordered absolute values of the difference scores using the approach
outlined in Section 10.1. Specifically, we assign ranks from 1 through n to the smallest through
largest absolute values of the difference scores, respectively, and assign the mean rank when
there are ties in the absolute values of the difference scores.
In this example, W+ = 89 and W- = 31. Recall that the sum of the ranks (ignoring the signs)
will always equal n(n+1)/2. As a check on our assignment of ranks, we have n(n+1)/2 =
15(16)/2 = 120 which is equal to 89 + 31. The test statistic is W = 31.
Step 5. Conclusion.
We do not reject H0 because 31 > 25. Therefore, we do not have statistically significant
evidence at α=0.05, to show that the median difference in systolic blood pressures is not zero
(i.e., that there is a significant difference in systolic blood pressures after the exercise program
as compared to before).
To perform the Wilcoxon signed-rank test in SPSS, you can follow these steps:
78
2. Go to "Analyze" in the top menu and select "Nonparametric Tests" and then "Legacy
Dialogs" and "Related Samples."
3. In the "Related Samples" dialog box, select the variables representing the paired
observations or within-subject measurements and move them to the "Paired Variables"
box.
SPSS will generate the output that includes the test statistics, the Wilcoxon signed-rank test
statistic (T value or W value), the significance level (p-value), and descriptive statistics for the
paired observations.
If the p-value is less than the chosen significance level (e.g., 0.05), it indicates a significant
difference between the paired observations.
If the p-value is greater than the significance level, it suggests that there is not enough evidence
to conclude a significant difference between the paired observations.
It is important to note that the Wilcoxon signed-rank test assesses differences in medians and
does not provide information about the direction or magnitude of the differences.
The Kruskal-Wallis test is a non-parametric statistical test used to determine if there are
significant differences among three or more independent groups or conditions. It is commonly
used when the data do not meet the assumptions required for parametric tests, such as analysis
of variance (ANOVA).
The Kruskal-Wallis test compares the ranks of the values between multiple groups to assess
whether the distributions of the groups differ significantly. It does not assume any specific
distribution for the data and is based on the rank order of the values.
1. Define the null hypothesis (H0) and the alternative hypothesis (H1):
2. Rank all the observations from all groups together, from the smallest to the largest value.
79
4. Calculate the test statistic, usually denoted as H or χ², using the formula:
12 𝑅𝑖 2
𝐻= ∑ − 3(𝑛 + 1)
𝑛(𝑛 + 1) 𝑛𝑖
where N is the total number of observations, Σ is the sum of the ranks squared for each
group, and n is the number of observations in each group.
• The critical value can be looked up in the Kruskal-Wallis table for a given significance
level (e.g., 0.05).
• The p-value can be calculated based on the test statistic and the degrees of freedom
using statistical software.
6. Compare the obtained test statistic to the critical value or evaluate the p-value:
• If the obtained test statistic is greater than the critical value or the p-value is less than
the chosen significance level (e.g., 0.05), reject the null hypothesis and conclude that
there is a significant difference between the groups.
• If the obtained test statistic is smaller than the critical value or the p-value is greater
than the significance level, fail to reject the null hypothesis and conclude that there is
not enough evidence to suggest a significant difference between the groups.
The Kruskal-Wallis test provides a way to compare three or more independent groups without
assuming a specific distribution for the data. It is often used in research studies, particularly
when dealing with ordinal or skewed data, or when parametric assumptions are violated.
Example:
A researcher wants to know whether or not three drugs have different effects on knee pain, so
he recruits 30 individuals who all experience similar knee pain and randomly splits them up
into three groups to receive either Drug 1, Drug 2, or Drug 3. After one month of taking the
drug, the researcher asks each individual to rate their knee pain on a scale of 1 to 100, with 100
indicating the most severe pain. The ratings for all 30 individuals are shown below:
The researcher wants to know whether or not the three drugs have different effects on knee
pain, so he conducts a Kruskal-Wallis Test using a .05 significance level to determine if there
80
is a statistically significant difference between the median knee pain ratings across these three
groups.
Solution:
Calculation of H:
𝐻 = 3.09
Step5. Interpretation.
Since the calculated value of chi-square is less than the critical value, do not reject the null
hypothesis, and it is concluded that there is no difference in the median knee-pain ratings.
Example:
Researchers want to know if three different fertilizers lead to different levels of plant growth.
They randomly select 30 different plants and split them into three groups of 10, applying a
different fertilizer to each group. At the end of one month, they measure the height of each
plant, and the data is given below. Use Kruskal-Wallis Test to determine if the median growth
is the same across the three groups.
81
Solution:
Calculation of H:
𝐻 = 6.204
Step5. Interpretation.
Since the calculated value of chi-square is more than the critical value, reject the null
hypothesis, and it is concluded that the median growth is not same across the three groups.
To perform the Kruskal-Wallis test in SPSS, you can follow these steps:
2. Go to "Analyze" in the top menu and select "Nonparametric Tests" and then "Legacy
Dialogs" and "K Independent Samples."
82
3. In the "K Independent Samples" dialog box, select the variable representing the dependent
variable (the variable you want to compare between groups) and move it to the "Test
Variable List" box.
4. Select the variable representing the grouping variable (the variable that defines the groups
you want to compare) and move it to the "Grouping Variable" box.
SPSS will generate the output that includes the test statistics, the Kruskal-Wallis test statistic
(H value or χ² value), the significance level (p-value), and descriptive statistics for each group.
• If the calculated value is more than the chosen significance level (e.g., 0.05), it indicates a
significant difference among the groups.
• If the calculated value is less than the significance level, it suggests that there is not enough
evidence to conclude a significant difference among the groups.
It is important to note that the Kruskal-Wallis test assesses differences in distributions and does
not provide information about the direction or magnitude of the differences.
The Friedman test is a non-parametric statistical test used to determine if there are significant
differences among three or more related groups or conditions. It is commonly used when the
data do not meet the assumptions required for parametric tests, such as repeated measures
analysis of variance (ANOVA).
The Friedman test compares the ranks of the values within each group across multiple
measurements to assess whether the distributions of the groups differ significantly. It does not
assume any specific distribution for the data and is based on the rank order of the values.
1. Define the null hypothesis (H0) and the alternative hypothesis (H1):
2. Rank the observations within each group separately, from the smallest to the largest value,
for each measurement.
3. Calculate the test statistic, usually denoted as χ², using the formula:
83
12
χ² = ∑ 𝑅𝑖 2 − 3𝑛(𝑘 + 1)
𝑛𝑘(𝑛 + 1)
where k is the number of groups, n is the total number of observations, Σ is the sum of the
ranks squared for each group, and n is the number of observations in each group.
• The critical value can be looked up in the chi-square distribution table for a given
significance level (e.g., 0.05) and degrees of freedom.
• The p-value can be calculated based on the test statistic and the degrees of freedom
using statistical software.
5. Compare the obtained test statistic to the critical value or evaluate the p-value:
• If the obtained test statistic is greater than the critical value or the p-value is less than
the chosen significance level (e.g., 0.05), reject the null hypothesis and conclude that
there is a significant difference among the groups.
• If the obtained test statistic is smaller than the critical value or the p-value is greater
than the significance level, fail to reject the null hypothesis and conclude that there is
not enough evidence to suggest a significant difference among the groups.
The Friedman test provides a way to compare three or more related groups without assuming
a specific distribution for the data. It is often used in research studies, particularly when dealing
with ordinal or skewed data or when parametric assumptions are violated.
Example
Suppose we want to know if the mean reaction time of subjects is different on three different
drugs. To test this, we recruit 10 patients and measure each of their reaction times (in seconds)
on the three different drugs. The results for each patient are shown below:
Each patient is measured on each of the three drugs. Use the Friedman Test to determine if the
mean reaction time differs between the three drugs.
84
Solution:
Calculation of χ²:
12
χ² = ∑ 𝑅𝑖 2 − 3𝑛(𝑘 + 1)
𝑛𝑘(𝑛 + 1)
12
χ2 = (1522 + 2302 + 832) − 3 × 10 × (3 + 1)
10 × 3 × (10 + 1)
χ² = 12.35
Step5. Interpretation.
Since the calculated value of chi-square is more than the critical value, reject the null
hypothesis, and it is concluded that the mean reaction time differs between the three drugs.
To perform the Friedman test in SPSS, you can follow these steps:
2. Go to "Analyze" in the top menu and select "Nonparametric Tests" and then "Legacy
Dialogs" and "Related Samples."
85
3. In the "Related Samples" dialog box, select the variables representing the related groups
or conditions and move them to the "Paired Variables" box.
5. Click on the "Options" button to specify the output options. You can choose to display
descriptive statistics, mean ranks, and/or post hoc tests.
SPSS will generate the output that includes the test statistics, the Friedman test statistic (χ²
value), the significance level (p-value), and the mean ranks for each group.
• If the p-value is less than the chosen significance level (e.g., 0.05), it indicates a
significant difference among the related groups.
• If the p-value is greater than the significance level, it suggests that there is not enough
evidence to conclude a significant difference among the related groups.
A goodness-of-fit test is a statistical test used to assess how well an observed dataset fits a
particular theoretical distribution or expected proportions. It allows you to determine whether
the observed data significantly deviates from the expected distribution.
Goodness-of-fit tests are commonly used in various fields, including statistics, economics,
biology, and social sciences. They are particularly useful when you want to assess whether your
data follows a specific distribution or when you have a set of expected proportions that you
want to compare against the observed data.
Chi-square goodness-of-fit test: This test compares the observed frequencies in different
categories or groups with the expected frequencies under a specified distribution or set of
proportions. It calculates the chi-square statistic, which measures the discrepancy between the
observed and expected frequencies.
Kolmogorov-Smirnov test: This test assesses the goodness of fit by comparing the cumulative
distribution function (CDF) of the observed data with the CDF of the expected distribution. It
calculates the Kolmogorov-Smirnov statistic, which represents the maximum absolute
difference between the two CDFs.
86
The choice of which goodness-of-fit test to use depends on the nature of your data and the
distribution you want to compare against. These tests provide statistical evidence to determine
if the observed data significantly deviates from the expected distribution or proportions.
It's important to note that a goodness-of-fit test does not prove that the observed data matches
the expected distribution perfectly. Rather, it assesses whether the observed data differs
significantly from what would be expected under the null hypothesis of a specified distribution
or proportions.
A Chi-Square goodness of fit test can be used in a wide variety of settings. Here are a few
examples:
• We want to know if a die is fair, so we roll it 50 times and record the number of times it
lands on each number.
• We want to know if an equal number of people come into a shop each day of the week, so
we count the number of people who come in each day during a random week.
• We want to know if the percentage of M&M’s that come in a bag are as follows: 20%
yellow, 30% blue, 30% red, 20% other. To test this, we open a random bag of M&M’s and
count how many of each colour appear.
Example:
The following table gives the number of aircraft accidents that occurred during the various days
of the week. Find whether the accidents are uniformly distributed over the week.
Is this result consistent with the hypothesis that the male and female births are equally
probable?
Solution:
87
Assuming uniformity, expected frequency for each day =
total frequency 92
= = 13.14
[Link] days 7
n
(Oi − Ei )2
Step 3: Calculate statistic by the formula =
2 2
i =1 Ei
(Oi − E i )2
O E O−E (O−E)2
Ei
14 13.14 0.86 0.7396 0.056
16 13.14 2.86 8.1796 0.622
8 13.14 -5.14 26.4196 2.011
20 13.14 6.86 47.0596 3.581
11 13.14 -2.14 4.5796 0.349
9 13.14 -4.14 17.1396 1.304
14 13.14 0.86 0.7396 0.056
92 92 2 = 7.98
Step 4: Critical Value: Table value for 2 with 6 d.f. at 5% level of significance 26,0.05 =
12.59
Step 5: Interpretation:
Since calculated value of 2 (7.98) is less than the critical value of 2, we do not
reject the null hypothesis. Hence we conclude that accidents are uniformly
distributed over the week.
Example:
A dice is tossed 120 times with the following results:
If the die is unbiased, then all the numbers have the same probability of happening.
Hence the expected frequency for all the numbers is 120/6 = 20.
n
(Oi − Ei )2
Step 3: Calculate statistic by the formula =
2 2
i =1 Ei
88
(Oi − E i )2
O E O−E (O−E)2
Ei
30 20 10 100 5.00
25 20 5 25 1.25
18 20 -2 4 0.20
10 20 -10 100 5.00
22 20 2 4 0.20
15 20 -5 25 1.25
120 120 2 = 12.90
Step 4: Critical Value: Table value for 2 with 5 d.f. at 5% level of significance 25,0.05 =
11.07
Step 5: Interpretation:
Since calculated value of 2 (12.90) is greater than the critical value of 2, we reject
the null hypothesis. Hence, we conclude that accidents are not uniformly
distributed over the week.
To perform a goodness-of-fit test in SPSS, you can use the "Nonparametric Tests" procedure.
This procedure allows you to test whether the observed frequencies in a categorical variable
deviate significantly from the expected frequencies.
1. Open SPSS and load your dataset with category number and frequencies.
2. Weight the cases with frequencies.
3. Go to "Analyze" in the menu bar and select "Nonparametric Tests" -> "Legacy Dialogs” -
> "Chi-square."
4. In the "Chi-square Test" dialog box, select the variable for which you want to perform the
goodness-of-fit test. Move it to the "Test Variable List" box.
5. Click on “All categories equal” in the “Expected Values” box.
6. Click "OK" to run the analysis.
SPSS will now generate the output, which includes the chi-square statistic, degrees of freedom,
and the associated p-value. The p-value indicates the significance level of the test. If the p-
value is below your chosen significance level (e.g., 0.05), you can reject the null hypothesis
and conclude that there is a significant difference between the observed and expected
frequencies.
Additionally, the output will provide a table showing the observed and expected frequencies
for each category of the variable you selected. The "Chi-Square Tests" table provides the test
statistics and p-value.
Remember, a goodness-of-fit test assumes that your data is categorical and that the expected
frequencies are known or can be calculated based on some theoretical distribution.
89
3.11 Chi-square Test
The chi-square test is a statistical test used to determine if there is a significant association or
difference between two categorical variables. It is based on the chi-square statistic, which
measures the discrepancy between the observed frequencies and the expected frequencies.
The chi-square test for independence examines whether there is a relationship between two
categorical variables. It determines whether the distribution of one variable is independent of
the distribution of the other variable. The null hypothesis assumes that there is no association
between the variables, while the alternative hypothesis suggests that there is an association.
For example, you could use a chi-square test for independence to analyze survey responses
from males and females and determine if there is a significant difference in their preferences.
The test statistic is calculated as the sum of the squared differences between the observed and
expected frequencies, divided by the expected frequencies. The resulting chi-square statistic
follows a chi-square distribution with degrees of freedom based on the number of categories in
the variables being compared.
The p-value associated with the chi-square statistic is used to make a decision. If the p-value is
below a chosen significance level (e.g., 0.05), the null hypothesis is rejected, suggesting that
there is a significant association or difference between the variables.
The chi-square test is commonly used in various fields, including social sciences, biology, and
market research, to analyse categorical data and test hypotheses about relationships or
distributions.
Example:
One thousand girls in a college were graded according to their I.Q. and the economic conditions
of their homes. Use 2 test to find out whether there is any association between economic
conditions at home and I.Q. of girls at 1% level of significance.
I.Q.
Economic Condition High Low Total
Rich 100 300 400
Poor 350 250 600
Total 450 550 1,000
Solution:
Step 1: H0: There is no association between economic condition at home and I.Q.
H1: There exists an association between economic condition at home and I.Q.
Step 2: Level of significance = 0.01;
Degrees of freedom v = (r−1)(c−1) = (2−1)(2−1) = 1
Calculate the expected frequency E corresponding to each cell by the formula
Ri C j
Eij = , where Ri = Sum total of the ith row
N
90
Cj = Sum total of the jth column
N = Grand Total (total sample size)
I.Q.
Economic Condition Sandals Sneakers Total
400 450 400 550
Rich = 180 = 220 400
1000 1000
600 450 600 550
Poor = 270 = 330 600
1000 1000
Total 450 550 1000
n
(Oi − Ei )2
Step 3: Calculate statistic by the formula =
2 2
i =1Ei
The characteristics of this distribution are completely defined by the number of
degrees of freedom v which is given by v = (r−1)(c−1), where r is the number of
rows and c is the number of columns.
(Oi − E i )2
O E O−E (O−E)2
Ei
100 180 −80 6400 35.5
300 220 80 6400 23.7
350 270 80 6400 29.1
250 330 −80 6400 19.4
2 = 107.7
Step 4: Critical Value: Table value for 2 with 1 d.f. at 1% level of significance 21,0.01 =
6.635
Step 5: Interpretation:
Since calculated value of 2 (107.7) is more than the critical value of 2, reject the
null hypothesis. Hence we conclude that there is association between economic
condition at home and I.Q.
Example:
A sample of 400 students of undergraduate and 400 students of postgraduate classes were taken
to know their opinion about autonomous colleges. 290 of the undergraduate and 310 of the
postgraduate students favoured the autonomous status. Present these facts in the form of a
table and test at 5% level, that the opinion regarding autonomous status of colleges are
independent of the level of classes of students.
Solution:
The contingency table of observed frequencies is as follows:
Favour Not in favour Total
Undergraduate 290 110 400
Postgraduate 310 90 400
Total 600 200 800
91
Step 1: H0: Options regarding autonomous status are independent of the level of classes.
H1: Options regarding autonomous status are dependent on the level of classes.
Ri C j
Eij = , where Ri = Sum total of the ith row
N
Cj = Sum total of the jth column
N = Grand Total (total sample size)
n
(Oi − Ei )2
Step 3: Calculate statistic by the formula =
2 2
i =1 Ei
(Oi − E i )2
O E O−E (O−E)2
Ei
290 300 −10 100 0.33
110 100 10 100 1.00
310 300 10 100 0.33
90 100 −10 100 1.00
2 = 2.66
Step 4: Critical Value: Table value for 2 with 1 d.f. at 5% level of significance 21,0.05 =
3.84
Step 5: Interpretation:
Since calculated value of 2 (2.66) is less than the critical value of 2, we do not
reject the null hypothesis. Hence we conclude that Options regarding autonomous
status are independent of the level of classes.
To perform a goodness-of-fit test in SPSS, you can use the "Crosstabs" procedure. This
procedure allows you to test whether the observed frequencies in a categorical variable deviate
significantly from the expected frequencies.
92
1. Open SPSS and load your dataset with categories and respective frequencies.
2. Weight the cases with frequencies.
3. Go to "Analyze" in the menu bar and select "Descriptive Statistics" -> "Crosstabs”.
4. In the "Crosstabs" dialog box, select the category 1 variable and move it to the "Row(s)"
box; select the category 2 variable and move it to the “Column(s)” box.
5. Click on “Statistics” and click on “Chi-square” box, and click “Continue”.
6. Click on “Cells” and select in the “Counts” box – “Observed” and “Expected”; click
“Continue”.
7. Click "OK" to run the analysis.
SPSS will now generate the output, which includes the crosstabulation table, and chi-square
statistic test table with chi-square value, degrees of freedom, and the associated p-value. The
p-value indicates the significance level of the test. If the p-value is below your chosen
significance level (e.g., 0.05), you can reject the null hypothesis and conclude that there is a
significant association between the two category variables.
Analysis of Variance (ANOVA) is a statistical method used to test for significant differences
between the means of three or more groups. ANOVA assesses the variation between and within
groups to determine if there are statistically significant differences in the means.
There are different types of ANOVA tests, including one-way ANOVA, factorial ANOVA, and
repeated measures ANOVA. Here, we'll focus on the basic concept of one-way ANOVA, which
is used when there is only one independent variable (factor) with multiple levels or groups.
Formulate hypotheses:
93
• Degrees of freedom between groups (dfbetween) = Number of groups - 1
• Degrees of freedom within groups (dfwithin) = Total sample size - Number of groups
9. Make a conclusion:
• If the p-value is less than the chosen significance level, reject the null hypothesis and
conclude that there are significant differences between the group means.
• If the p-value is greater than or equal to the significance level, fail to reject the null
hypothesis and conclude that there is no significant difference between the group
means.
ANOVA can be conducted using statistical software like SPSS, where you can specify the
variables and perform the analysis to obtain the results, including the F-statistic, p-value, and
other relevant statistics.
Example:
The following data are the semester tuition charges (Rs.’000) for a sample of private colleges
in various regions of the State. At the 0.05 significance level, can we conclude there is a
difference in the mean tuition rates for the various regions?
Region
Northeast Southeast West
10 8 7
11 9 8
12 10 6
10 8 7
12 6
Solution:
Computation of Sum of squares:
94
0 −2 −3
1 −1 −2
2 0 −4
0 −2 −3
2 −4
5 −5 −16 G = −16
G 2 (−16) 2
(i) Correction Factor = = = 18.29
N 14
= 62.45 − 18.29
= 44.16
Sum of
Source of variation Degrees of freedom Mean Sum of Squares F-ratio
Squares
44.16
Between regions 3−1 = 2 44.16 = 22.08
2 22.08
= 25.43
9.55 0.87
Within regions 13 −2 = 11 9.55 = 0.87
11
Total 14−1 = 13 53.71
95
Step 4 : Critical Values: F0.05,2,11 = 3.98
Step 5: Inference:
Since F-ratio is greater than the critical value, we reject the null hypothesis.
Hence we can conclude that there is significant difference in the mean tuition rates
for various regions.
Problem:
The data regarding life (in hours) of three types of bulbs manufactured by a company are given
in the following table. Test the hypothesis that mean life of bulbs of different types are same.
Types of Bulbs A 16 18 19
B 14 13 15 20
C 18 17 19 21 21
Solution:
Computation of Sum of squares:
Coded data for ANOVA (Subtract 18 from all observations)
Total
A −2 0 1 −1
B −4 −5 −3 2 −10
C 0 −1 1 3 3 6
G 2 (−5) 2
(i) Correction Factor = = = 2.08
N 12
96
Step 2: Level of significance = 0.05
Mean Sum of
Source of variation Degrees of freedom Sum of Squares F-ratio
Squares
Total 11 76.92
Step 5: Inference:
Since F-ratio is less than the critical value, we do not reject the null hypothesis.
Hence, we can conclude that there is no significant difference in the mean life of
different types of bulbs.
To perform a one-way ANOVA in SPSS, you can use the "General Linear Model" (GLM)
procedure. This procedure allows you to analyze the differences in means across multiple
groups or levels of a single independent variable.
SPSS will generate the output, which includes various tables containing the results of the one-
way ANOVA.
The ANOVA table provides key information, including the F-statistic, degrees of freedom, and
associated p-value. The p-value indicates the significance level of the test. If the p-value is
below your chosen significance level (e.g., 0.05), you can reject the null hypothesis and
conclude that there are significant differences between the group means.
If you selected the "Descriptive Statistics" option, you will also see a table with means, standard
deviations, and other descriptive statistics for each group.
97
Remember to ensure that the assumptions of ANOVA are met, such as the normality of
residuals, homogeneity of variances, and independence of observations. If the assumptions are
violated, you may need to consider alternative analyses or transformations of the data.
Sum of
Source of variation Degrees of freedom Mean Sum of Squares F-ratio
Squares
SSR MSR
Between rows (r−1) SSR MSR =
r −1 MSE
Between SSC MSC
(c−1) SSC MSC =
columns c −1 MSE
SSE
Residual (Error) (r−1)(c−1) SSE MSE =
(r − 1)(c − 1)
Total n− 1 SST
Example:
A company has appointed four salesmen, A,B,C and D, and observed their sales in three seasons
– summer, winter and monsoon. The figures (in Rs lakhs) are given in the following table:
Salesmen
Seasons A B C D Season Totals
Summer 36 36 21 35 128
Winter 28 29 31 32 120
Monsoon 26 28 29 29 112
Salesmen Total 90 93 81 96 360
Using 5 per cent level of significance, perform an analysis of variance on the above data and
interpret the results.
Solution:
Coded data for ANOVA (Subtract 29 from all observations)
Salesmen
Seasons A B C D Season Totals
Summer 7 7 −8 6 12
Winter −1 0 2 3 4
98
Monsoon −3 −1 0 0 −4
Salesmen Total 3 6 −6 9 12
G 2 12 2
(i) Correction Factor = = = 12
N 12
x
1
(iii) Between seasons Sum of Squares = SSR = 2
i. − C.F .
4 i
=
4
(
1 2
12 + 4 2 + (−4) 2 − 12 )
= 44 − 12 = 32
x
1
(iv) Between salesmen Sum of Squares = SSC = 2
.j − C.F .
3 j
=
3
(
1 2
3 + 6 2 + (−6) 2 + 9 2 − 12 )
= 54 − 12 = 42
(v) Error Sum of Squares = SSE = SST − SSR − SSC = 210 − 32 − 42 = 136
Step 1: We set up the hypothesis in respect of seasons
H0: There is no difference in the mean sales in the three seasons, i.e., 1 = 2 = 3
H1: There is difference in the mean sales in the three seasons, i.e., 1 2 3
Between 42 14
4−1 = 3 42 = 14.00 = 0.62
salesmen 2 22.67
136
Within samples 23=6 136 = 22.67
6
Total 12−1 = 11 210
99
Step 4 : Critical Values: For seasons: F0.05,2,6 = 5.14
For salesmen : F0.05,3,6 = 4.76
Step 5: Inference:
Since F-ratios for both seasons and salesmen are less than their respective critical
values, we do not reject the null hypotheses. Hence we can conclude that
(i) there is no difference in the mean sales in different seasons and
(ii) there is no difference in the performance of different salesmen.
Example:
The following data represent the number of units of production per day turned out by four
different workers using five different types of machines.
Machine Type
Worker A B C D E Total
1 4 5 3 7 6 25
2 5 7 7 4 5 28
3 7 6 7 8 8 36
4 3 5 4 8 2 22
Total 19 23 21 27 21 111
On the basis of this information, can it be concluded that (i) the mean productivity is the same
for different machines, (ii) the workers do not different with regard to productivity?
Solution:
Coded data for ANOVA (Subtract 7 from all observations)
Machine Type
Worker A B C D E Total
1 −3 −2 −4 0 −1 −10
2 −2 0 0 −3 −2 −7
3 0 −1 0 1 1 1
4 −4 −2 −3 1 −5 −13
Total −9 −5 −7 −1 −7 −29
G 2 29 2
(i) Correction Factor = = = 42.05
N 20
x
1
(iii) Between workers Sum of Squares = SSR = 2
i. − C.F .
5 i
=
1
5
((−10) 2 + (−7) 2 + 12 + (−13) 2 − 42.05 )
100
= 63.8 − 42.05 = 21.75
x
1
(iv) Between machines Sum of Squares = SSC = 2
.j − C.F .
4 j
=
1
4
( )
(−9) 2 + (−5) 2 + (−7) 2 + (−12 ) + (−7) 2 − 42.05
To perform a two-way ANOVA in SPSS, you can use the "General Linear Model" (GLM)
procedure. This procedure allows you to analyze the effects of two independent variables
(factors) on a dependent variable and examine their interactions.
101
3. In the "Univariate" dialog box, select the dependent variable that you want to analyze and
move it to the "Dependent Variable" box.
4. Select the first independent variable (factor) that represents one of the main effects. Move
it to the "Fixed Factor(s)" box.
5. Select the second independent variable (factor) that represents the other main effect. Move
it to the "Fixed Factor(s)" box.
6. Click on the "Model" button to specify the model and interactions. In the "Model" dialog
box, select the main effects and interactions you want to include in the analysis.
7. Click on the "Options" button if you want to specify any additional options, such as
descriptive statistics or post hoc tests.
8. In the "Options" dialog box, you can select the desired options and click "Continue" to
return to the "Univariate" dialog box.
9. Click "OK" to run the analysis.
SPSS will generate the output, which includes various tables containing the results of the two-
way ANOVA.
The "Tests of Between-Subjects Effects" table provides the key information for each main
effect and interaction, including the F-statistic, degrees of freedom, and associated p-value. The
p-value indicates the significance level of the test. If the p-value is below your chosen
significance level (e.g., 0.05), you can reject the null hypothesis and conclude that there are
significant effects or interactions.
If you selected the "Descriptive Statistics" option, you will also see a table with means, standard
deviations, and other descriptive statistics for each combination of the independent variables.
Post hoc tests, such as Tukey's HSD or Bonferroni corrections, can be conducted to determine
which specific group means are significantly different from each other, especially in the
presence of significant interactions.
Remember to ensure that the assumptions of ANOVA are met, such as the normality of
residuals, homogeneity of variances, and independence of observations. If the assumptions are
violated, you may need to consider alternative analyses or transformations of the data.
102
13. Under which circumstances Kruskal Wallis test is conducted? Write down the steps to
conduct Kruskal Wallis test.
14. List out the steps to conduct Kruskal Wallis test in SPSS.
15. What is Friedman test? Write down the steps to perform it.
16. What is goodness-of-fit test?
17. Write down the steps in SPSS to perform goodness of fit test.
18. What is chi-square test for independence of attributes?
19. Write down the steps to perform chi-square test for independence of attributes.
20. Write down the steps to perform chi-square test for independence of attributes in SPSS.
21. What is one-way ANOVA? Write down the steps to perform it.
22. Explain the steps to carry out one-way ANOVA in SPSS.
23. What is two-way ANOVA? Write down the steps to perform it.
24. Explain the steps to carry out two-way ANOVA in SPSS.
103
SPSS distinguishes between parametric and non-parametric tests based on sample size and data distribution. For large samples, parametric tests like Z-tests and t-tests are typically used if data meet assumptions of normality and homogeneity of variance. Parametric tests consider mean differences and require known population parameters, providing powerful inference capabilities. Conversely, non-parametric tests, such as Mann-Whitney U, Wilcoxon signed-rank, and Kruskal-Wallis tests, are suitable for small samples or ordinal data, not assuming specific distributions. These tests rank data rather than relying on distribution parameters, making them robust against assumption violations in small or skewed data .
To perform a Mann-Whitney U test in SPSS, open your dataset and go to "Analyze," then select "Nonparametric Tests," followed by "Legacy Dialogs" and "2 Independent Samples." Choose the dependent variable (the variable to be compared) and move it to the "Test Variable(s)" box. Select the grouping variable and move it to the "Grouping Variable" box. Run the analysis by clicking "OK." SPSS outputs the test statistics including the U value and p-value. If the p-value is less than the set significance level (e.g., 0.05), it indicates a significant difference between the groups' distributions. Otherwise, there is insufficient evidence for a significant difference .
The Chi-square test in SPSS is significant for examining associations between categorical variables by comparing observed to expected frequencies under independence assumptions. It's valuable for large sample sizes where the assumption of cell counts is met. However, when sample sizes or expected frequencies are small, the Chi-square assumptions may not hold, making Fisher's exact test a practical alternative. Fisher's test examines associations within a 2x2 contingency table without these assumptions, offering exact p-values. Both tests provide insights into potential relationships between categorical data sets, applicable based on sample size constraints .
In SPSS, after performing a Kruskal-Wallis test, which compares three or more independent groups, interpret the results by checking if the calculated test statistic exceeds the critical value at a given significance level. For instance, a calculated chi-square value of 6.204 being greater than the critical value of 5.99 with a significance level α = 0.05 implies rejection of the null hypothesis. Therefore, it can be concluded that there are significant differences among the distributions of the groups, although the test does not specify which groups differ or the magnitude of these differences .
The Wilcoxon signed-rank test is used for evaluating differences between paired observations or related samples, particularly when data do not meet parametric test assumptions. It assesses whether the median of paired differences is zero. After calculating the differences and ranking them, the sum of ranks of positive and negative differences (W+ and W-) is determined. Comparing the test statistic with the critical value, or evaluating the p-value, indicates significant differences if the test statistic is lower or the p-value smaller than the significance level. The test indicates significant median differences between paired observations .
The Friedman test is preferable over repeated measures ANOVA in SPSS when data do not meet ANOVA assumptions, like normality or sphericity, especially with ordinal or non-normally distributed data. It's non-parametric and operates on ranked data to assess differences across three or more related groups in longitudinal or repeated-measures studies. The test's primary application is to determine if there's a significant difference in group distributions. It does not assume specific population distributions, offering a flexible alternative for handling deviations in ANOVA assumptions .
To present village population data in SPSS, particularly through a pie chart, first ensure that the data is categorized appropriately in the SPSS dataset. Open the dataset, navigate to "Variable View," and identify the variable for the pie chart. In "Data View," select "Graphs" from the menu, then "Chart Builder." Choose the "Pie" chart type from the Gallery, and drag it onto the canvas. Select the categorical variable for the chart into the "Slice by" box and include frequencies or percentages into the "Summaries of" box. After customization, generate the pie chart by selecting "OK." This visual representation helps in understanding proportions within the village population .
To compare the efficiency of two machines based on production output in SPSS, use a t-test for small sample sizes. With given summary statistics for two samples, such as n1 = n2 < 30 and respective means and variances, calculate the t statistic using the formula: t = (x1 - x2) / √((S²/n1) + (S²/n2)), where S² is the pooled variance. Make sure to define null (equality of means) and alternative hypotheses (difference in means). Calculate the degrees of freedom and reference a t-distribution table to determine significance. A larger calculated t than the critical value leads to rejecting the null hypothesis, suggesting efficiency differences .
To test the hypothesis about the effectiveness of an advertisement campaign using SPSS on a small sample, first set up a null hypothesis that the mean sales per shop remain unchanged (e.g., H0: μ = 140 dozens). Choose an alternative hypothesis indicating the sales increase post-campaign (H1: μ > 140). With a sample size of 26 and standard deviation of 16, and at a 5% significance level, calculate the t statistic as t = ((147 - 140) / (16/√26)) = 2.23. Determine the critical t value for 25 degrees of freedom at this level (t25,0.05 = 1.708). Since the calculated t value (2.23) is greater than the critical value (1.708), reject the null hypothesis, suggesting that the advertisement is effective .
To create a simple bar chart in SPSS, you should first go to the "Data View" by clicking the corresponding tab at the bottom left of the SPSS window. Then, go to "Graphs" in the menu bar at the top and select "Chart Builder." Within the "Gallery" section of the Chart Builder dialog, click on the "Bar" chart type and drag the "Simple Bar" chart icon onto the chart canvas. Select the categorical variable you intend to use for the bar chart from the "Variables" section and drag it into the "X-Axis" box. To display frequencies or percentages on the y-axis, drag the variable into the "Y-Axis" box. Finally, click "OK" to generate the bar chart, and SPSS will display it in a new chart window .