
































Studia grazie alle numerose risorse presenti su Docsity
Guadagna punti aiutando altri studenti oppure acquistali con un piano Premium
Questa pagina non è visibile nell’anteprima
Non perderti parti importanti!

































o It reduces the data to a simpler and more understandable form (graphs, tables, numbers)
o It’s useful when data are available for the entire population
population
o It uses the data to make predictions
o It applies when data is available only for a sample
Measurement
phenomena
in a country, the typical wages offered in a given industry…
Ways to measure
Topic: opinion on gun control
Option #1: in-depth interview
rich, complex understanding of views
Disadvantages: it’s hard to gather information on many people, complexity makes comparison
difficult
Option #2: ask people a very pointed question (yes/no question)
form
Disadvantages: simplification of information, much detail is lost
Units of analysis
It is the thing which we collect information about
Units and scales
o In general, differences in this kind of unit are trivial
o Example : the difference between measuring temperature in degrees versus a labeling days
as “hot” and “cold”
o Nominal
o
Ordinal
o Interval or ratio
Variables
magnitudes of the variable (ex: age, number of siblings)
Nominal scales
No category is greater/smaller than any other category
o
Measuring gender: male, female
o Country of residence: US, Japan, Mexico…
o
Religion: Protestant, Catholic, Hindu…
o Country’s regime: democratic vs. non-democratic
Nominal scales involve categories that are:
o Homogeneous à all people in that category must have a commonality
o Mutually exclusive à people can’t fit into more than one category
o Exhaustive à there should be a category for everyone
Problem: Suppose you are interested in measuring “religion”, but a person is both Protestant and Jewish.
What do you do?
Options:
religions”)
Ordinal scales
“ordered”
Ordinal scales are:
o Homogeneous
o Mutually exclusive
o
Ordered
o
Example: Department rankings, we don’t know how big the difference is between ranks of
1 & 2, or 20 and 21 (the difference may be small or large)
Interval scales
distance
Interval scales are:
o Homogeneous
o Ordered
o Measured in comparable units
o Continuous measures can be measured with arbitrary precision à between any two
possible values there is always another possible value
o Discrete measures can only take on specific values (integers) à basic unit of measurement
that cannot be subdivided
o Is it rounded off to the “hour” – e.g., “42 hours”?
o Or can it be measured with infinite precision: e.g., “41.6890243908432 hours”?
Validity
o If validity is very poor, measurements become meaningless
o
Validity isn’t an “all or nothing” thing
Finite population
based on them may be highly unreliable
o Example: volunteer samples, such as polls on the Internet, often are severely biased (but,
sometimes volunteer samples are all we can get, as in most medical studies)
Sampling error
The sampling error of a statistic equals the error that occurs when we use a sample statistic to
predict the value of a population parameter
predictable size
o We’ll learn methods that let us predict magnitude (the margin of error ) e.g., in estimating a
percentage, no more than about +3% or - 3% when n about 1000
o Sampling bias (ex: non-probability sampling)
o
Response bias (ex: poorly worded questions)
o Nonresponse bias (ex: under coverage, missing data)
Results of surveys can depend greatly on question wording
From measurement to datasets
Suppose we measured 5 people regarding views on gun control and gun ownership:
Data is often organized in a spread sheet:
Columns reflect sets of measurements or “variables”
Issue: To facilitate data analysis, it is best to enter data as numbers, rather
than text (often called “coding” data)
Less good option: Use text words “Favor” and “Oppose” in our gun control dataset Better option: Convert
“Favor” and “Oppose” to numeric values
Example: 1 = favor, 0 = oppose
Advantage: more computation options
Disadvantage: Data is harder to interpret by eye
Listing variables
o Easy
o Gives a rich description – you can see every case
Disadvantages:
o Cumbersome for large datasets
o If data involves complex coding, you may not be able to interpret it visually
Frequency lists
distribution)
o Congressional vote. How many “Yes” vs
“No”?
o Social class: How many = low, middle,
upper?
o Age: How many = 1 years old, 2 years, ...
100 years?
Advantages:
o Useful for large datasets
o Fairly rich description of data – once you
get used to reading them…
o Unlike a list, you can’t see which case is which or compare with other variables
o
Best for nominal and some ordinal variables only
o Not useful if all values are unique, such as: rank orderings, many continuous variables
Frequency distribution for categorical data
Bar Chart
Essentially a visual representation of a frequency list
For nominal & some ordinal variables only
Pie Chart
Similar, but divides up a circle to show frequency
Frequency distribution for quantitative data
Sets of similar values must be “grouped”
o Lumped together by constant intervals
o Note: Information is destroyed in the process
Histograms: interval width
Small interval = more bars in the histogram
o Wide intervals/few bars results in greater simplification of data
o histogram age, discrete width (5)
o histogram age, discrete width (10)
o histogram age, discrete width (1)
o
We may wish to know how much money the typical family earns
o We may wish to know the age of the typical person in our dataset
The median is the value of the “middle case” à equal number of cases fall higher or lower
o Not influenced by unusual peaks
o Useful even in very even distributions
o
Not useful for data spread in two distinct “clumps”
If the number of statistical units n is even, there are two middle positions: n / 2 and n / 2 + 1
o If the units corresponding to these two positions have the same modality, this modality is
the median; if they have different modalities: the median is indeterminate (if the variable is
ordinal), the median is the average of the two modalities (if the variable is quantitative)
Grouped data
and x i
, the separator value of the two
classes (x i
) is chosen as the median
the following formula:
𝑀𝑒 = 𝑥
!
!
"
$% #$%
&
Quantiles
o
100 chunks = percentiles
o 10 chunks = deciles
o
5 = quintiles
o 4 = quartiles
Upper and lower bounds of quantiles are useful reference points that describe your data
o The border of the 2
nd
and 3
rd
quartile is the median, the middle of your data
o Sometimes people report “ interquartile range ”à the range of values that contains the
middle 50% of cases
Example: number of CD’s owned (N = 12)
o A person with 200 CDs is in the top quartile à 75% have less
Useful questions that quantiles help answer:
o Example: I scored 57 on a test... is that good?
o
Strategy: Determine the percentile
o If 57 corresponds to the 22
nd
percentile, then the answer is NO!, at least not compared to
the others who took the test
o If I scored 51 on my math test and 78 on my English test, which is better?
o Converting to percentiles allows a direct comparison
§ Ex: 51 on math = 95
th
percentile; 78 on English = 62
nd
§ Conclusion: Math performance was better!
Boxplots
pth percentile: p percent of observations below it, (100 - p )% above it
o p = 50 à median (if it is at the middle of the box, it means that the distribution is
symmetrical)
o
p = 25 à lower quartile (LQ)
o p = 75 à upper quartile (UQ)
Interquartile range IQR = UQ - LQ
o Minimum, LQ, median, UQ, maximum except for outliers
identified separately
o Below LQ - 1,5(IQR)
o Above UQ +1,5(IQR)
Mean
o Useful for continuous measures
o Not overly influenced by any single peak
Disadvantages:
o Can be influenced by extreme values
Calculating the mean: variables
The mean and extreme values
Very different groups can have the same mean
Mean and median
because uses numerical values of observations
Skewness
Skewness refers to the symmetry of a distribution
o Tail on left à skewed to left = negative skew
o Tail on right à skewed to right = positive skew
o Perfectly symmetrical distributions have no skew
fewer cases
o Example: Economic wealth of nations
Interpreting skewness
Skewness may reflect “floor” or “ceiling” effects
o Lower bound is zero. Mode is low. Few cases are high. Variable is skewed to right
o Cannot exceed 100% enrollment in school
Calculating skewness
Statisticians have created a measure
o Zero = perfectly symmetrical
o Higher number = increasing skew
'(Ȳ$*+,)
.
&
Remember, mean moves more if there are extreme cases, as when there is a “tail”
o Look at a histogram to identify skewness
o Thus, it can be very important to identify highly skewed variables
Properties of the mean
o In contrast to the mode & median
o Probably the most commonly used measure of “central tendency”
Disadvantages
o Every case influences outcome... even unusual ones
o Extreme cases affect results a lot
o The mean doesn’t give you any information on the shape of the distribution
§ Cases could be very spread out, or very tightly clustered
maximum value assumed by the variable itself, that is 𝒙
𝒎𝒊𝒏
𝒎𝒂𝒙
a constant its average is also multiplied by the same constant, that is 𝑴
values from their arithmetic mean is equal to zero
𝒊
𝒏
𝒊 4 𝟏
𝒊
𝒏
𝒊 4 𝟏
squares property)
𝒊
𝟐
𝒏
𝒊 4 𝟏
Example: property 2
The persons listed in the table are a work team: if they realize a project, they will receive a fixed price of
1000€ each and an increase of 5% wage. What will be the average salary earned by members of the team if
you can carry out the project?
Theorems of the mean (1)
The arithmetic mean of k subgroup (of k subpopulation) for each of which is already known the value of the
arithmetic mean, it is equal to the weighted arithmetic mean of the average of the individual groups.
Example
k = 4 degrees; X = age
Theorems of the mean (2)
The arithmetic mean of the sum (or difference) of two (or more variables) is equal to the sum (or
difference) of the arithmetic mean of the individual variables.
Example
The table shows the travel time (in minutes) to reach the workplace (X) and the trave time by public
transport (Y) of 5 individuals.
Calculate the overall average travel time to reach the workplace.
Example: review of theorems
The table shows the travel times in minutes for 10 Frecciarossa Italia trains on the Rome-Bologna and
Bologna-Milan routes, indicated respectively with X and Y.
Knowing that the theoretical travel time of the entire journey, RM-MI, is equal to 270 minutes, indicate
with W the variable “total delay reported by the trains”. Calculate the overall mean delay for Roma-Milano.
Shannon’s diversity index (entropy)
>
!
log(𝑓
!
.
!'()
!
log(𝑓
!
log(𝐾)
1
Minimum and maximum
They are affected by outliers
was 20 0
Range
o
In case of CD ownership, 200 - 0 = 200
o Easily influenced by extreme values à may not be representative
o Doesn’t tell you anything about the middle cases
Interpreting dispersion
Question: What are possible social interpretations of the different distributions (all with the same mean)?
Measures of dispersion
the story
o How “dispersed”, “varied” are your cases?
o Are most cases like the “typical” case? Or not?
o Average absolute deviation
o Variance
o Standard deviation
o
Coefficient of variation
Idea of deviation
Positive deviation : case has higher value than mean
Extreme positive/negative indicates cases further from mean
Deviation of a case
𝒊
It’s the distance from the mean (Y-bar) à difference between each observation and the mean
cannot measure the variability
Example
Turning the deviation into a useful measure of dispersion
Idea #1: Add it all up
The sum of deviation for all cases: ∑ 𝑑
!
%
! 4 #
o 12.5, 7.5, - 32.5, 37.
o Because mean is the exact center of all cases
o Cases equally deviate positively and negatively
o Conclusion: You can’t measure dispersion this way
Idea #2: Sum up “absolute value” of deviation
!
%
! 4 #
o Doesn’t allow comparison across samples
Idea #3: The Average Absolute Deviation
∑ |
|
#+%
%
∑ | A
$A
B |
#+%
%
Digression: Here we have used the mean to determine “typical” size of case deviations
Originally, I introduced the mean as a way to analyze actual case values (e.g. # of CDs owned)
o In other words a statistic, the mean, is being used to analyze another statistic – a deviation
This is a general principle that we will use often: statistics can help us understand our raw data and
also further summarize our statistical calculations!
Average absolute deviation
o What is Average absolute deviation? 22.
average
Turning the deviation into a useful measure of dispersion
Idea #4: Square the deviation to avoid problems of negative values
Properties of the variance
a constant quantity is added, the variance does not
change à 𝑉(𝑋 + 𝑎) = 𝑠
;
7
is multiplied by a constant b, the variance is multiplied by the constant b in square à
7
Variance: theorem 1
The variance of a mixture of k groups (or subpopulations), for each of which the variance value is already
known, is equal to the sum of two variances, that is: 𝑠
7
D
7
E
7
Within variance à the mean of the group variance (use formula of the mean applied to the variances)
D
7
!
7
!
8
! 4 #
Between variance à the variance of the group mean (use formula of the variance applied to the means)
E
7
!
7
!
8
! 4 #
Variance: theorem 2
The variance of the sum (or difference) of two variables is equal to the sum of variances of the individual
variables only if they are independent à if the increase of X doesn’t produce a change in Y (or vice versa),
the variance of Z is equal to the sum of the variance of X and the variance of Y
Z-Score: standardized score
o
Somewhat like a deviation
o Ex: I’m a - .3 on math, a +1.2 on reading
o Negative = below mean, positive = above mean
Formula for Z-Score
𝒊
𝒅
𝒊
𝒔
𝒀
(𝒀
𝒊
$𝒀
I )
𝑺
𝒀
deviation
Z-Score example
Question 1: What is the Z-score of a person who has a high-school degree? (12 yrs)
!
!
A
!
o
)
A
Question 2: What is the Z-score of an advanced graduate student? (22 yrs)
!
!
A
!
o
)
A
Properties of Z-Scores
o Cases on the mean score zero
o Positive values are above mean, negative below
o
Simple deviations can’t be compared if units of measurement are different (ex: height and
weight)
o A Z-score of - 1.83 indicates a case is nearly 2 standard deviations below the mean
Z-scoring whole variables
o With useful properties
o But, mean and standard deviation are altered
Mean = zero
o Because it is based on deviations
o
Because distance from mean = divided by sy
Z-Score example
Number of CDs: mean = 32,5 s = 29,
Z-Scoring whole variables
o
Unit of variable is literally “standard deviations”
o If a value = 1, it means the cases is 1 S.D above mean
o Ex: a variable measured in # of CDs makes sense, but a variable in # of S.D.s is harder to
interpret
Z-Scores and index construction
Issue: It is often useful to combine several variables to create an “index”
o Do you approve of President’s foreign policy?
o Do you approve of the President’s domestic policy?
o Do you approve of the President’s character?
o For each individual, the scale goes from 3 to 15
The function {𝑥, 𝑓(𝑥)} with 𝑓(∙) ≥ 0 is said density function and it is such that:
;
$K
and ∫ 𝑓
K
$K
= 1 where 𝑃(𝑋 ≤ 𝑥) represents the area under the curve 𝑓(∙) to the
point x, that is, cumulative distribution function
For continuous random variables P (X=x)=0, the possible cases are infinite and therefore
!
Exercise
Consider two 3-sided dice and the random variable ’Sum of the two dice’. Build the random variable X
Bernoullian Experiment
It is random experiment consisting of a set of n repeated tests with the following characteristics:
n=1 à Bernoulli random variable
n>1 à Binomial random variable
Bernoulli random variable
and p with **_0 Example: Binomial random variable
Given a deck of 52 cards, you draw 5 cards with replacement and consider the variable: X=number of hearts
cards.
a) Which variable is?
#'
L
à 𝑋 ≈ 𝐵𝑖𝑛( 5 , 0. 25 )
b) Probability of pulling 3 hearts?
'
L$'
'
7
c) Probability to extract at least 3 hearts?
L
'
'
7
L
M
M
L
L
L
N
d) Probability to pull out at 3 hearts
e) Probability of not pulling hearts
L
N
N
L
f) Probability of extracting at least 1 heart
Gaussian or Normal random variable
density function:
O√ 7 Q
$
(/$ 0 )
"
" 2
"
It is symmetrical with respect to x= μ
(symmetry point: mean, mode and median coincide)
It is asymptotic with respect to the abscissa axis
68% of cases is in the range mean ± standard deviation
99% of cases is in the range mean ± 3 standard deviation
Shape indicators
Kurtosis
Skewness
Z-scores formula
𝑿$𝝁
𝝈