Last lecture summary
Download
Report
Transcript Last lecture summary
Last lecture summary
β’ Which measures of variability do you know?
β’ What are they advantages and disadvantages?
β’ Empirical rule
Statistical jargon
population (census) vs. sample
parameter (population) vs. statistic (sample)
Population - parameter
Mean π
Standard deviation π
Sample - statistic
Mean π₯
Standard deviation s
VýbΔr - statistika
VýbΔrový prΕ―mΔr π₯
VýbΔrová smΔrodatná odchylka s
Statistical inference
β’ A statistic is a value calculated from our observed data
(sample).
β’ A parameter is a value that describes the population.
β’ We want to be able to generalize what we observe in our
data to our population. In order to this, the sample needs
to be representative.
β’ How to select a representative sample? Use
randomization.
New stuff
Random sampling
β’ Simple Random Sampling (SRS) β each possible
sample from the population is equally likely to be
selected.
β’ Stratified Sampling β simple random sample from
subgroups of the population
β’ subgroups: gender, age groups, β¦
β’ Cluster sampling β divide the population into non-
overlapping groups (clusters), sample is a randomly
chosen cluster
β’ example: population are all students in an area, randomly select
schools and create a sample from students of the given school
Simple random sampling
β’ sampling with replacement (WR)
β’ výbΔr s navrácením
β’ Generates independent samples
β’ Two sample values are independent if that what we get on the first
one doesn't affect what we get on the second.
β’ sampling without replacement (WOR)
β’ výbΔr bez navrácení
β’ Deliberately avoid choosing any member of the population more
than once.
β’ This type of sampling is not independent, however it is more
common.
β’ The error is small as long as
1. the sample is large
2. the sample size is no more than 10% of population size
Bias
β’ If a sample is not representative, it can introduce bias into
our results.
β’ bias β zkreslení, odchylka
β’ A sample is biased if it differs from the population in a
systematic way.
β’ The Literary Digest poll, 1936, U. S. presidential election
β’ surveyed 10 mil. people β subscribers
β’ 2.3 mil. responded predicting (3:2) a Republican candidate to win
β’ a Democrat candidate won
β’ What went wrong?
β’ only wealthy people were surveyed (selection bias)
β’ survey was voluntary response (nonresponse bias) β angry people or
people who want a change
Besselβs correction
π =
π₯π β π₯
πβ1
2
www.udacity.com β Statistics
Sample vs. population SD
β’ We use sample standard deviation to approximate
population paramater Ο
π =
π₯π β π₯
πβ1
2
β π=
π₯π β π
π
2
β’ But donβt get confused with the actual standard deviation
of a small dataset.
β’ For example, letβs have this dataset: 5 2 1 0 7. Do you
divide by π or by π β 1?
Bessel's game
π=2
8
2
π =
3
Bessel's game
β’ An important property of a sample statistic that estimates
a population parameter is that if you evaluate the sample
statistic for every possible sample and average them all,
the average of the sample statistic should equal to the
population parameter.
We want:
possible
population
average of all sample =
variance
variances
β’ This is called unbiased.
Besselβs game
1.
2.
List all possible samples of 2 cards.
Calculate sample averages.
Population of all cards in a bag
Sample
Sample
average
Besselβs game
1.
2.
3.
4.
List all possible samples of 2 cards.
Calculate sample averages.
Now, half of you calculate sample
variance using /n, and half of you
using /(n-1).
And then average all sample variances.
π 2
Population of all cards in a bag
π₯π β π₯ 2
=
π OR π β 1
Sample
Sample
average
0,2
1
0,4
2
2,0
1
2,4
3
4,0
2
4,2
3
0,0
0
2,2
2
4,4
4
Sample
variance
8
π = 2, π =
3
Besselβs game
2
Sample
Sample
average
Sample variance (n-1)
Sample variance (n)
0,2
1
2
1
0,4
2
8
4
2,0
1
2
1
2,4
3
2
1
4,0
2
8
4
4,2
3
2
1
0,0
0
0
0
2,2
2
0
0
4,4
4
0
0
average
18
=2
9
24 8
=
9
3
12 4
=
9
3
Median absolute deviation (MAD)
β’ standard deviation is not robust
β’ IQR is robust
β’ mean absolute deviation MAD β a robust equivalent of the
standard deviation
β’ Také your data, find median, calculate absolute deviation
from the median, find the median of absolutes deviations
Median absolute deviation (MAD)
Data
Median deviation
5
10
30
20
30
5
15
10
15
Median:
MAD:
Absolute deviation
NORMAL
DISTRIBUTION
Playing chess
β’ Pretend I am a chess player.
β’ Which of the following tells you most about how good I
am:
1.
2.
3.
My rating is 1800.
8110th place among world competitive chess players.
Ranked higher than 88% of competitive chess players.
Distribution
We should use relative
frequencies and convert
all absolute frequencies
to proportions.
Distribution of scores in one particular year
Height data β absolute frequencies
http://wiki.stat.ucla.edu/socr/index.php/SOCR_Data_Dinov_020108_HeightsWeights
Height data β relative frequencies
Height data β relative frequencies
What proportion
of values is
between 170 cm
and 173.75 cm?
30%
Height data β relative frequencies
What proportion of
values is between
170 cm and 175 cm?
We canβt tell for
certain.
β’ How should we modify data/histogram to allow us a more
detail?
1.
2.
3.
Adding more value to the dataset
Increasing the bin size
A smaller bin size
Height data β relative frequencies
What proportion of values is between 170 cm and 175 cm?
36%
Height data β relative frequencies
Height data β relative frequencies
recall the empirical rule
Normal distribution
68-95-99.7
1
π₯βπ
ππ₯π β
2π 2
2ππ
2