STAT1008 Lecture Notes - Lecture 7: Bar Chart, Categorical Variable
STAT1008 Week 3 Lecture A
● Difference in proportions:
○ Difference in proportions is a difference in proportions for one categorical
variable calculated for different levels of the other categorical variable
○ E.g. proportion of females in a relationship - proportional of males in a
relationship.
○ Literally just calculate the bigger number - the smaller number tf
● Side by Side bar chart
○ The height of each bar is the number of the corresponding cell in the two-
way table
● Segmented bar chart:
○ A segmented bar chart is like a side by side bar chart, but the bars are
stacked instead of side-by-side
● One Quantitative Variable:
○ Dotplot:
■ Each case is represented by a dot and dots are stacked
■ Easy way to see each case
○ Histogram:
■ The height of each bar corresponds to the number of cases within
that range of the variable
■ Histogram vs bar chart:
● Bar chart is categorical data and the x-axis has no numeric
scale
● Histogram is for quantitative data and the x-axis is numeric
● For categorical variable, the number of bars = the number of
categories, and the number in each category is fixed
● For quantitative variable, the number of bars in a histogram
is up to you (or your software), and the appearance can
differ with different number of bars
○ Shape:
■ Right-skewed = long right tail
■ Left-skewed = long left tail
■ Bell shaped = middle is the tallest
● Notation:
○ The sample size, the number of cases in the sample is denoted by n
find more resources at oneclass.com
find more resources at oneclass.com
Document Summary
Difference in proportions is a difference in proportions for one categorical variable calculated for different levels of the other categorical variable. E. g. proportion of females in a relationship - proportional of males in a relationship. Literally just calculate the bigger number - the smaller number tf. The height of each bar is the number of the corresponding cell in the two- way table. A segmented bar chart is like a side by side bar chart, but the bars are stacked instead of side-by-side. Each case is represented by a dot and dots are stacked. The height of each bar corresponds to the number of cases within that range of the variable. Bar chart is categorical data and the x-axis has no numeric scale. Histogram is for quantitative data and the x-axis is numeric. For categorical variable, the number of bars = the number of categories, and the number in each category is fixed.