0% found this document useful (0 votes)
5 views36 pages

Creating Bar Diagrams and Charts in SPSS

The document provides a comprehensive guide on creating various types of diagrams and charts using SPSS, including simple bar diagrams, multiple bar diagrams, pie charts, histograms, and scatter plots. It explains the purpose and differences between these visualizations, along with step-by-step instructions for data entry and chart creation. Additionally, it discusses correlation coefficients and regression analysis, highlighting their applications in statistical analysis.

Uploaded by

swastikthakur0
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views36 pages

Creating Bar Diagrams and Charts in SPSS

The document provides a comprehensive guide on creating various types of diagrams and charts using SPSS, including simple bar diagrams, multiple bar diagrams, pie charts, histograms, and scatter plots. It explains the purpose and differences between these visualizations, along with step-by-step instructions for data entry and chart creation. Additionally, it discusses correlation coefficients and regression analysis, highlighting their applications in statistical analysis.

Uploaded by

swastikthakur0
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

A Simple Bar Diagram with an example dataset

the primary purpose of a simple bar diagram is to visually compare


frequencies or means across different categories of a nominal or
ordinal variable, allowing for easy identification of differences and
trends within a single dataset.
By representing counts or averages as bars of varying heights, these
charts provide a straightforward way to understand and communicate
the distribution and magnitude of a variable across distinct groups.
Suppose we have a product categories and their corresponding sales
values.

Enter Data in SPSS


1. Open IBM SPSS.
2. In the Data View tab, enter the data in DataView.
3. Switch to the Variable View tab and define variables:
o Category → Type: String (Nominal)
o Sales → Type: Numeric (Scale)
Create a Simple Bar Diagram
1. Click Graphs → Chart Builder.
2. In the Chart Builder window:
o Drag Bar → Simple Bar (the first option) into the
canvas.
o Set Category → X-axis.
o Set Sales → Y-axis.
3. Click OK.

Difference between a Multiple Bar Diagram and a Sub-


divided Bar Diagram.
Both multiple bar diagrams and sub-divided bar diagrams are used to
represent data visually, but they serve different purposes and have
distinct characteristics.
1. Multiple Bar Diagram: (Clustered Bar Chart)
 A multiple bar diagram displays two or more sets of data
side by side for comparison.
 Each category is represented by a group of bars, where
each bar corresponds to a different data set.

 This type of diagram is useful for comparing the same


categories across different groups. For Example suppose
we record Sales in 2024 and 2025 for three products:

 On the X-axis: Products (A, B, C).


 For each product: two bars side by side (2024, 2025).
Sub-divided Bar Diagram: (Stacked Bar Chart)

 A sub-divided bar diagram, also known as a stacked bar


diagram, shows the total of a category divided into sub-
categories.

 Each bar represents the total of a category, and the


segments within the bar represent the different sub-
categories that make up that total.

 This type of diagram is useful for showing the composition


of a whole and how different parts contribute to it.

 For the above sample dataset,


 On the X-axis: Products (A, B, C).

 Each product has one bar, where the bottom


segment shows Sales 2024 and the top segment
shows Sales 2025.

Summary of Differences

Create a Percentage Diagram (Pie Chart) representing the


distribution of expenses in a household budget. Include categories
like rent, groceries, utilities, and entertainment with their
respective percentages.
Expense Category Percentage
Rent 40
Groceries 30
Utilities 20
Entertainment 10
Enter Data in SPSS
1. Open SPSS.
o In Variable View, create two variables:
o Category → Type: String (Nominal).
o Percentage → Type: Numeric (Scale).
2. In Data View, enter the values:
Category Percentage
Rent 40
Groceries 30
Utilities 20
Entertainment 10
Step 3: Create Pie Chart
Method 1: Using Menus
1. Go to Graphs → Chart Builder.
2. Choose Pie/Polar → Pie chart.
3. Drag Category to the Slice By box.
4. Drag Percentage to the Define Slices By box.
5. Click OK.
SPSS will display a pie chart, with each slice
proportional to the percentage.
 A pie chart showing:
o Rent = 40%
o Groceries = 30%
o Utilities = 20%
o Entertainment = 10%
Each slice will be labelled with the category and percentage.
Construct a Histogram to visualize the distribution of ages
in a survey of 10 participants. Use appropriate bin sizes
and label the axes.

A histogram is a type of graphical representation used in statistics to


show the distribution of numerical data.
It looks similar like a bar chart, but unlike bar graphs, which are used
for categorical data, histograms are designed for continuous data,
grouping it into logical ranges, which are also known as "bins."
A histogram helps in visualizing the distribution of data across a
continuous interval or period which makes the data more
understandable and also highlights the trends and patterns.
Open SPSS.
In Variable View, create a variable named Age (Type: Numeric,
Scale).
In Data View, enter the ages of the 10 participants. For example:

Participant Age
1 21
2 23
3 25
4 29
5 31
6 35
7 38
8 40
9 42
10 45
Creating Histogram
1. Go to the menu:
Graphs → Chart Builder → Histogram.
2. Select the variable Age.
3. Tick the option Display normal curve (optional).
4. Click OK.
 The X-axis will represent Age (years).
 The Y-axis will represent Frequency (number of
participants).
 SPSS automatically chooses bin sizes (e.g., 20–25, 26–30, 31–
35, etc.), but you can adjust them:
 Go to Graphs → Chart Builder → Histogram.
 Click on Element Properties to set custom bin widths
(e.g., 5 years per bin).
Output in SPSS:
 A histogram showing how many participants fall into each age
interval in the OutputViewer.
 For the above data (ages 21–45), if bin width = 5 years, intervals
would be:
 20–25 → 3 participants
 26–30 → 1 participant
 31–35 → 2 participants
 36–40 → 2 participants
 41–45 → 2 participants
Construct a Multiple Bar Diagram to represent the sales
performance of two competing smartphone brands (Brand A and
Brand B) in five different cities over a year.
Enter Data in SPSS
1. Open SPSS → go to Variable View.
o Create three variables:
 City (String) → e.g., “City1”, “City2”, … “City5”
 Brand (String) → “Brand A”, “Brand B”
 Sales (Numeric)
2. Switch to Data View → Enter data in long format (stacked),
like this:
City Brand Sales
City1 Brand A 1200
City1 Brand B 1500
City2 Brand A 1000
City2 Brand B 1300
City3 Brand A 1400
City3 Brand B 1600
City4 Brand A 900
City4 Brand B 1100
City5 Brand A 1250
City5 Brand B 1350

Step 2: Create the Multiple Bar Diagram


 In the top menu: Graphs → Chart Builder
 Select Bar → Clustered Bar (this is the multiple bar chart).
 Drag it into the canvas.
 Assign variables:
o X-axis: City

o Cluster on X: Brand

o Y-axis: Sales

 Click OK.
Format the Chart
 Double-click the chart to open the Chart Editor.
 Add axis labels (e.g., “Cities” on X-axis, “Sales (units)” on Y-
axis).
 Add a legend (to distinguish Brand A vs. Brand B).
 Change bar colors for clarity (e.g., Yellow for Brand A, blue for
Brand B).
A Multiple Bar Diagram where for each city, two bars appear side
by side — one for Brand A, one for Brand B — making it easy to
compare their sales performance.

Steps to Create a Pie Chart in SPSS (Chart Builder)


Prepare Data
 Make sure the data has at least one categorical variable (e.g.,
City, Gender, Brand) and optionally a frequency/count variable
(e.g., Sales, Number of Students).
 Example data:
City Sales
City1 120
City2 150
City3 90
City4 140
Open Chart Builder
1. From the menu, go to Graphs → Chart Builder.
2. If prompted, click OK on the “Define Variable Properties”
dialog box.
Select Pie Chart
1. In Chart Builder, under Gallery, select Pie/Polar.
2. Drag Pie Chart into the canvas.
Assign Variables
1. Drag the categorical variable (e.g., City) to the Slice by? box.
2. If you have frequencies (e.g., Sales), drag it into the Count or
Summary Statistics box.
 By default, SPSS uses Count (number of cases).
 You can also choose % of total, sum of a variable, etc.

Customize
 Click on Element Properties (top right of Chart Builder) to:
 Show Percentages or Counts on slices.
 Change slice labels.
 Adjust colors for clarity.
Generate the Chart
 Click OK.
 Your pie chart will appear in the Output Viewer.
Pie Chart that shows proportions of categories clearly.

Sales Distribution across cities.

Scatter plot and different types of correlation by using scatter


plot.

Scatter Plot:
A scatter plot is a graphical representation that uses dots to display
the relationship between two quantitative (numeric) variables.
 The X-axis usually shows the independent variable (e.g., study
hours).
 The Y-axis shows the dependent variable (e.g., test scores).
 Each point represents a pair of values.
Scatter plots help to visualize correlation (the strength and direction
of the relationship).

Types of Correlation in Scatter Plots


1. Positive Correlation
o As X increases, Y also increases.
o Example: Study hours ↑ → Test scores ↑
o The scatter points slope upward (left to right).
2. Negative Correlation
o As X increases, Y decreases.
o Example: Absenteeism ↑ → Exam performance ↓
o The scatter points slop
o e downward.
3. No Correlation
o No clear upward or downward trend.
o Example: Shoe size vs. Intelligence.
o The points are scattered randomly.

Steps to Create a Scatter Plot


1. Enter your data (two numeric variables).
2. Go to Graphs → Chart Builder.
3. In the Gallery, select Scatter/Dot → choose Simple Scatter.
4. Drag it into the canvas.
5. Put the independent variable (e.g., Hours) on the X-axis.
6. Put the dependent variable (e.g., Scores) on the Y-axis.
7. Click OK → Scatter plot appears in the Output Viewer.

scatter plots with sample data showing the three main types of
correlation:
 Positive Correlation → points slope upward (X ↑, Y ↑)
 Negative Correlation → points slope downward (X ↑, Y ↓)
 No Correlation → points scattered randomly with no clear
trend

Plot Histogram, Frequency polygon and Frequency Curve.


CI Fre
q

10-20 15

20-30 17

30-40 20

40-50 25

50-60 14

60-70 10

70-80 18

Plot a Histogram, Frequency Polygon, and Frequency Curve in


IBM SPSS for the given data:

Class Interval (CI) Frequency


10–20 15
20–30 17
30–40 20
40–50 25
50–60 14
60–70 10
70–80 18

Enter the Data in SPSS


1. Open IBM SPSS Statistics.
2. In Variable View:
o Create two variables:
 ClassMid (Numeric) → represents class midpoints
 Frequency (Numeric)
3. In Data View, enter:
4. (ClassMid = midpoint of each class interval, e.g., (10+20)/2 =
15)

ClassMid Frequency
15 15
25 17
35 20
45 25
55 14
65 10
75 18

Plot the Histogram


1. Go to Graphs → Chart Builder.
2. Choose Histogram → drag it into the canvas.
3. Drag ClassMid to the X-axis and Frequency to the Y-axis.
4. Click OK to generate the histogram.
Histogram Output:
A bar chart showing the frequency distribution for each class interval.
Plot the Frequency Polygon
Option 1: Using Chart Builder (Line Chart)
1. Go to Graphs → Chart Builder.
2. Choose Line → Simple Line → drag to the canvas.
3. Drag ClassMid to the X-axis and Frequency to the Y-axis.
4. Click OK.
Frequency Polygon Output:
A line graph connecting midpoints of class intervals showing the
distribution shape.

Plot the Frequency Curve


The frequency curve is a smoothed version of the frequency polygon.
1. Go to Graphs → Chart Builder → Line Chart (same as
frequency polygon).
2. After the chart is produced:
o Double-click the chart → opens Chart Editor.
o In Chart Editor, click on the line.
o Choose Smooth line or Curve interpolation from the
toolbar (depending on SPSS version).
Frequency Curve Output:
A smooth curve passing through or near the points of the frequency
polygon.
SPSS Graph
Type X-axis Y-axis Shape
Option
Class Rectangular
Histogram Histogram Frequency
Midpoint Bars
Frequency Class Straight Line
Line Chart Frequency
Polygon Midpoint Segments
Frequency Line Chart Class
Frequency Smooth Curve
Curve (Smoothed) Midpoint

Differences between Karl Pearson's correlation coefficient and


Spearman's rank correlation coefficient in IBM SPSS?
In IBM SPSS, both Karl Pearson’s correlation coefficient and
Spearman’s rank correlation coefficient are used to measure the
strength and direction of association between two variables.
But they differ in data type, assumptions, and interpretation.

 Use Pearson’s r when data are continuous, normally


distributed, and show a linear trend.
 Use Spearman’s ρ when data are ordinal, non-normal,
or when the relationship is monotonic but not linear.

comparison table and the primary differences

Karl Pearson’s Spearman’s Rank


Feature Correlation Coefficient Correlation Coefficient
(r) (ρ or rs)
Measures monotonic
Measures linear
Type of (rank-based) relationship
relationship between two
Relationship (increasing or decreasing,
variables
not necessarily linear)
Ordinal, interval, or
Data Type Interval or ratio scale
ratio scale (data can be
Required (continuous data)
ranked)
Assumptions 1. Data are normally 1. No assumption of
distributed 2. normality 2. Works with
Relationship is linear 3. non-linear monotonic
No significant outliers relationships 3. Less
Karl Pearson’s Spearman’s Rank
Feature Correlation Coefficient Correlation Coefficient
(r) (ρ or rs)
affected by outliers
Uses ranks of data (or
Basis of
Uses actual data values converts data into ranks
Calculation
before computation)
Range of
–1 to +1 –1 to +1
Coefficient
+1 → perfect positive +1 → perfect positive rank
linear correlation –1 → correlation –1 → perfect
Interpretation perfect negative linear negative rank correlation 0
correlation 0 → no linear → no monotonic
correlation correlation
Sensitivity to Highly sensitive to Less sensitive; ranks
Outliers extreme values reduce outlier influence
Analyze → Correlate → Analyze → Correlate →
SPSS
Bivariate… → Select Bivariate… → Select
Procedure
Pearson Spearman
Relationship between Relationship between class
Use Case
height and weight (both rank and test score
Example
continuous, linear) (ordinal or non-linear)

Simple regression analysis and explain its main purpose in


statistics.
Simple regression analysis  It is a statistical technique
used to study the relationship between two variables (ie)
one independent variable (X) and one dependent variable
(Y) by fitting a straight line (regression line) to the
observed data.
This line is called the line of best fit, is represented by the
equation:

where:
 Y = dependent (predicted) variable
 X = independent (predictor) variable
 a = intercept (value of Y when X = 0)
 b = slope (rate of change in Y for one-unit change in X)

Main Purpose in Statistics:


The primary purposes of simple regression analysis are:
1. Prediction:
To predict the value of the dependent variable (Y) based
on the known value of the independent variable (X).
Example: Predicting a student’s test score based on study
hours.
2. Explanation:
To explain how and to what extent the independent
variable affects or influences the dependent variable.
Example: Understanding how advertising expenditure
influences sales revenue.
3. Relationship Quantification:
To quantify the strength and direction of the
relationship between X and Y through the regression
equation and correlation coefficient.
4. Trend Estimation:
To identify trends or patterns in data for forecasting
and decision-making.

In SPSS:
We can perform simple regression using:
Analyze → Regression → Linear → select your Dependent
and Independent variables.

Simple linear regression analysis and its key


components.
How is it different from correlation analysis?

Simple Linear Regression Analysis


Simple linear regression is a statistical method used to study
the relationship between two quantitative variables one
independent variable (X) and one dependent variable (Y).

It aims to model how changes in the independent variable


predict or explain variations in the dependent variable. The
relationship is expressed using a linear equation of the form:

where:
 Y = Dependent variable (the outcome being predicted)
 X = Independent variable (the predictor)
 a = Intercept (value of Y when X = 0)
 b = Slope (the amount by which Y changes for a one-unit
increase in X)
 e = Error term (the difference between the observed and
predicted values of Y)

Key Components of Simple Linear Regression:


1. Dependent Variable (Y): The variable whose value is
being predicted or explained.
2. Independent Variable (X): The variable used to predict
the dependent variable.
3. Regression Line: The best-fitting straight line that
minimizes the sum of squared differences between
observed and predicted values (using the least squares
method).
4. Slope (b): Indicates the strength and direction of the
relationship.
5. Intercept (a): The starting point of the regression line on
the Y-axis.
6. Coefficient of Determination (R²): Measures how well
the regression line explains the variability in Y.

Difference Between Regression and Correlation:


Simple Linear
Aspect Correlation Analysis
Regression
Measures the strength and
Predicts the value
direction of the
Purpose of one variable
relationship between two
based on another.
variables.
Simple Linear
Aspect Correlation Analysis
Regression
Has dependent (Y) Treats both variables
Variables and independent symmetrically (no
(X) variables. dependence).
Provides an
Provides a single
Equation equation ( Y = a +
coefficient (r).
bX ).
Describes how
Describes how strongly X
Interpretation much Y changes
and Y move together.
when X changes.
One-way
No direction implied (just
Directionality relationship (X →
association).
Y).
Predicts actual Correlation coefficient (r)
Value Range
values of Y. ranges from -1 to +1.

Correlation quantifies  association, while regression


establishes  a predictive or causal relationship between
two variables.

One-sample t-test and its usage and what is the null


hypothesis in this test?
One-Sample t-Test:
A one-sample t-test is a statistical test used to determine
whether the mean of a single sample significantly differs
from a known or hypothesized population mean.
It helps to assess if the observed sample provides enough
evidence to reject the assumption that the sample mean equals
the population mean.

When It Is Used:
The one-sample t-test is used when:
1. You have one sample and want to compare its mean to a
known or theoretical value (e.g., a standard, benchmark,
or population mean).
2. The population standard deviation is unknown.
3. The data are approximately normally distributed
(especially for small sample sizes, ( n < 30 )).
4. The measurement scale is interval or ratio.
Example:
Testing whether the average height of a group of students
differs from the national average height of 165 cm.

Typical Null and Alternative Hypotheses:


Hypothesis

Depending on the research question, the alternative can also


be one-tailed:

Test Statistic Formula:

where:
The one-sample t-test evaluates whether a sample’s mean
significantly deviates from a known or expected population
mean when the population standard deviation is unknown.

Compare and contrast the assumptions


underlying the one-sample t-test and the two
independent sample t-test.

1. Purpose
 One-Sample t-test:
Tests whether the mean of a single sample differs
significantly from a known or hypothesized population
mean.
 Two Independent Sample t-test:
Tests whether the means of two independent groups are
significantly different from each other.

2. Assumptions (Comparison Table)


Two Independent
Assumption One-Sample t-test
Sample t-test
The data in both
The data are
groups are continuous
Type of Data continuous (interval
(interval or ratio
or ratio scale).
scale).
Both samples are
The sample is randomly and
Random
randomly drawn from independently drawn
Sampling
the population. from their respective
populations.
The sample data Each group’s data
should be should be
approximately approximately
Normality
normally distributed normally distributed
(especially important (especially for small
when n < 30). samples).
Observations between
Observations within
Independence and within groups are
the sample are
of independent (no
independent of each
Observations overlap or pairing
other.
between groups).
Homogeneity Not applicable (only The population
of Variances one sample). variances of the two
groups are equal
(assumed for the
pooled t-test; if not,
Two Independent
Assumption One-Sample t-test
Sample t-test
use Welch’s t-test).
Same—measured on
The variable should an interval or ratio
Scale of
be measured on an scale.
Measurement
interval or ratio scale.

 Both tests assume normality and independence.


 The two-sample test adds one extra assumption equal
population variances (homogeneity).
 The one-sample test compares one group mean to a
known value, while the two-sample test compares two
group means.

key differences between the two independent


sample t-test and the paired t-test.

Purpose
Two Independent
Aspect Paired t-test
Sample t-test
Objective Compares the means of Compares the means of
two independent two related (paired)
groups to see if they measurements on the
Two Independent
Aspect Paired t-test
Sample t-test
same subjects or matched
differ significantly.
pairs.

Nature of Samples
Two Independent
Aspect Paired t-test
Sample t-test
The samples are
The samples are
dependent (related).
independent .No
Relationship The same individuals
relationship between
Between are measured twice
the participants in one
Samples (e.g., before and after)
group and those in the
or matched pairs are
other.
used.
Comparing before and
Comparing exam
after treatment scores
Examples scores of two
of the same group of
different classes.
patients.

Data Structure
Two Independent
Aspect Paired t-test
Sample t-test
Data Type Two separate Two sets of related
samples (Group 1 observations for each
Two Independent
Aspect Paired t-test
Sample t-test
subject (e.g., Time 1 and
and Group 2).
Time 2).
Test Difference between paired
Difference between
Statistic observations (mean of the
group means.
Based On difference scores).

Assumptions
Two Independent
Aspect Paired t-test
Sample t-test
The differences
Both groups should
between pairs should be
Normality be approximately
approximately normally
normally distributed.
distributed.
Pairs are dependent, but
Observations between
each pair is
Independence groups are
independent of other
independent.
pairs.
Equal Assumes equal Not required
Variances variances between
variances within pairs
groups (for the pooled
are analyzed through
version).
differences.
Two Independent
Aspect Paired t-test
Sample t-test

 The independent t-test compares two unrelated


groups.
 The paired t-test compares two related or repeated
measures on the same subjects.
 The paired test controls for individual differences,
making it more powerful when measurements are related.

You might also like