Chapter 4 Simple Random Samples

advertisement
Chapter 4
Simple Random Sampling
Definition of Simple Random Sample
(SRS) and how to select a SRS
 Estimation of population mean and total;
sample size for estimating population
mean and total
 Estimation of population proportion;
sample size for estimating population
proportion
 Comparing estimates

Simple Random Samples

Desire the sample to be representative of
the population from which the sample is
selected

Each individual in the population should
have an equal chance to be selected

Is this good enough?
Example

1.
2.
3.




Select a sample of high school students as follows:
Flip a fair coin
If heads, select all female students in the school as the
sample
If tails, select all male students in the school as the
sample
Each student has an equal chance to be in the sample
Every sample a single gender, not representative
Each individual in the population has an equal chance
to be selected. Is this good enough?
NO!!
Simple Random Sample

A simple random sample (SRS) of size
n consists of n units from the population
chosen in such a way that every set of n
units has an equal chance to be the
sample actually selected.
Simple Random Samples (cont.)
•
•
•
•
•
Suppose a large History class of 500 students has 250 male and 250
female students.
To select a random sample of 250 students from the class, I flip a fair
coin one time.
If the coin shows heads, I select the 250 males as my sample; if the
coin shows tails I select the 250 females as my sample.
What is the chance any individual student from the class is included in
the sample? 1/2
This is a random sample. Is it a simple random sample? NO!
Not every possible group of 250 students has
an equal chance to be selected.
Every sample consists of only 1 gender –
hardly representative.
Simple Random Samples (cont.)
 The easiest way to choose an SRS is with
random numbers.
Statistical software
can
generate random
digits
(e.g., Excel
“=random()”,
ran# button on
calculator).
Example: simple random sample

Academic dept wishes to randomly choose a
3-member committee from the 28 members
of the dept
00 Abbott
01 Cicirelli
02 Crane
03 Dunsmore
04 Engle
05 Fitzpat’k
06 Garcia
07 Goodwin 14 Pillotte
08 Haglund 15 Raman
09 Johnson 16 Reimann
10 Keegan
17 Rodriguez
11 Lechtenb’g 18 Rowe
12 Martinez 19 Sommers
13 Nguyen
20 Stone
21 Theobald
22 Vader
23 Wang
24 Wieczoreck
25 Williams
26 Wilson
27 Zink
Solution
•
Use a random number table; read 2-digit pairs
until you have chosen 3 committee members
For example, start in row 121:
•
71487 09984 29077 14863 61683 47052 62224 51025
•
Garcia (07) Theobald (22) Johnson (10)
 Your calculator generates random numbers; you
can also generate random numbers using Excel
Sampling Variability
•
Suppose we had started in line 145?
•
19687 12633 57857 95806 09931 02150 43163 58636
Our sample would have been
19 Rowe, 26 Williams, 06 Fitzpatrick
•
Sampling Variability
•
•
•
•
•
Samples drawn at random generally differ
from one another.
Each draw of random numbers selects
different people for our sample.
These differences lead to different values for
the variables we measure.
We call these sample-to-sample differences
sampling variability.
Variability is OK; bias is bad!!
Example: simple random sample
Using Excel tools
 Using statcrunch (NFL)

4.3 Estimation of population
mean

Usual estimator
y 
1
n

n
yi
i 1
R ecall that E ( y )  
W hat about the variability of y
from sam ple to sam ple?
4.3 Estimation of population
mean

For a simple random sample of size n chosen without
replacement from a population of size N

 N n
V (y) 


n  N 1 

2
The correction factor takes into account that an estimate
based on a sample of n=10 from a population of N=20
items contains more information than a sample of n=10
from a population of N=20,000
4.3 Estimating the variance of the
sample mean

Recall the sample variance
s
2

1
n
(y

n 1
i
 y)
2
i 1
It can b e sh o w n (A p p en d ix A ) th at
E (s ) 
2
N
N 1

2
4.3 Estimating the variance of the
sample mean
S o V ( y ) can b e u n b iased ly estim ated b y
N

n
s
n
s




Vˆ ( y )  
 1 


N  n
 N  n

2
1
n
2
is called th e
N
fin ite p o p u latio n co rrectio n (fp c)
4.3 Estimating the variance of the
sample mean
If
n
N

1
,
20
th e fp c is u su ally ig n o red , so
2
s
ˆ
V (y) 
n
4.3 Example

Population {1, 2, 3, 4}; n = 2, equal weights
Sample
y
Pr. of sample
s2
Vˆ ( y )
{1, 2}
1/6
1.5
0.5
0.125
{1, 3}
1/6
2.0
2.0
0.500
{1, 4}
1/6
2.5
4.5
1.125
{2, 3}
1/6
2.5
0.5
0.125
{2, 4}
1/6
3.0
2.0
0.500
{3, 4}
1/6
3.5
0.5
0.125
For exam ple, {1, 2}:
2  0.5 0.5

ˆ
V ( y )  1  

 0.125
4 2
4

4.3 Example

Population {1, 2, 3, 4};
Sample
=2.5,
2
= 5/4; n = 2, equal weights
y
Pr. of sample
Vˆ ( y )
s2
{1, 2}
1/6
1.5
0.5
0.125
{1, 3}
1/6
2.0
2.0
0.500
{1, 4}
1/6
2.5
4.5
1.125
{2, 3}
1/6
2.5
0.5
0.125
{2, 4}
1/6
3.0
2.0
0.500
{3, 4}
1/6
3.5
0.5
0.125
E ( y )  1.5 
1
6
  2.0    2.5    2.5    3.0    3.5   
V ( y )  (1.5  2.5)
2
1
1
1
1
1
6
6
6
6
6
 
1
6
 (3.5  2.5)
2
 
1
6
5
12




N n
N 1
2.5  


 n
2
4.3 Example

Population {1, 2, 3, 4};
Sample
=2.5,
2
= 5/4; n = 2, equal weights
y
Pr. of sample
Vˆ ( y )
s2
{1, 2}
1/6
1.5
0.5
0.125
{1, 3}
1/6
2.0
2.0
0.500
{1, 4}
1/6
2.5
4.5
1.125
{2, 3}
1/6
2.5
0.5
0.125
{2, 4}
1/6
3.0
2.0
0.500
{3, 4}
1/6
3.5
0.5
0.125
2
E (s ) 
0.5  2.0  4.5  0.5  2.0  0.5
6
E (Vˆ ( y )) 
 N 
 

3  N 1
5
0.125  0.5  1.125  0.125  0.5  0.125
6

5
12
2

V (y)
4.3 Example Summary

Population {1, 2, 3, 4};
Sample
=2.5,
2
= 5/4; n = 2, equal weights
y
Pr. of sample
s2
Vˆ ( y )
{1, 2}
1/6
1.5
0.5
0.125
{1, 3}
1/6
2.0
2.0
0.500
{1, 4}
1/6
2.5
4.5
1.125
{2, 3}
1/6
2.5
0.5
0.125
{2, 4}
1/6
3.0
2.0
0.500
{3, 4}
1/6
3.5
0.5
0.125
 N n 5


n  N  1  12
2
E ( y )  2.5   , V ( y ) 
2

n
s
  5
ˆ
E (V ( y ))  E   1 
 V (y)
 
N  n  12

4.3 Margin of error when
estimating the population mean
M arg in o f erro r (M O E ), also called "b o u n d
o n th e erro r o f estim atio n "
t .0 2 5 , n  1
Vˆ ( y )  t .0 2 5 , n  1
2
n s

;
1 

N  n

o ften th e valu e o f z fro m N (0 ,1 ) is u sed :
2
n
s


1 .9 6 Vˆ ( y )  1 .9 6  1 

N  n

t distributions
Very similar to z~N(0, 1)
 Sometimes called Student’s t
distribution; Gossett, brewery employee
 Properties:
i) symmetric around 0 (like z)
ii)degrees of freedom 

if  > 1 , E ( t ) = 0
if  > 2 ,  =
bigger than 1.

 -2
, w hich is alw ays
Student’s t Distribution
P(t > 2.2281) = .025
P(t < -2.2281) = .025
.95
.025
-2.2281
0
.025
2.2281
t10
Standard normal
P(z > 1.96) = .025
P(z < -1.96) = .025
.95
.025
-1.96
.025
0
1.96
z
Student’s t Distribution
z 
y
t 

y
s
n
n
Z
t
-3
-3
-2
-2
-1
-1
00
11
22
33
Figure 11.3, Page 372
Student’s t Distribution
Degrees of Freedom
s =
s
t 
2
y
s
n
 (X
s
2
=
i
 X)
n
2
i =1
Z
n -1
t1
-3
-3
-2
-2
-1
-1
00
11
22
33
Figure 11.3, Page 372
Student’s t Distribution
Degrees of Freedom
s =
s
t 
2
y
s
n
 (X
s
2
=
i
 X)
n
2
i =1
Z
n -1
t1
t7
-3
-3
-2
-2
-1
-1
00
11
22
33
Figure 11.3, Page 372
4.3 Margin of error when
estimating the population mean
A d d in g M O E to y an d su b tractin g M O E
fro m y g ives 9 5 % co n fid en ce in terval:
2
y  t .0 2 5 , n  1
n s

1 

N  n

or
2
n s

y  1 .9 6  1 

N  n

4.3 Margin of error when
estimating the population mean

Understanding confidence intervals; behavior of
confidence intervals.
4.3 Margin of error when
estimating the population mean
M o re g en erally, (1   )% co n fid en ce in terval:
2
y  t
2
, n 1
n s

1 

N  n

or
2
y  z
2
n s

1 

N  n

Comparing t and z Critical
Values
z = 1.645
z = 1.96
z = 2.33
z = 2.58
Conf.
level
90%
95%
98%
99%
n = 30
t = 1.6991
t = 2.0452
t = 2.4620
t = 2.7564
4.4 Determining Sample Size
to Estimate 
Required Sample Size To
Estimate a Population Mean 
If you desire a C% confidence interval
for a population mean  with an
accuracy specified by you, how large
does the sample size need to be?
 We will denote the accuracy by MOE,
which stands for Margin of Error.

Example: Sample Size to
Estimate a Population Mean 
Suppose we want to estimate the
unknown mean height  of male
students at NC State with a confidence
interval.
 We want to be 95% confident that our
estimate is within .5 inch of 
 How large does our sample size need to
be?

Confidence Interval for 
In term s o f th e m arg in o f erro r M O E ,
th e C I fo r  can b e ex p ressed as
y  MOE
T h e co n fid en ce in terval fo r  is
y t
*
n 1
 s 


 n 
so M O E  t
*
n 1
 s 


 n 
S o w e can fin d th e sam p le size b y so lvin g
th is eq u atio n fo r n :
MOE  t
*
n 1
 s 


 n 
 t
s 
w h ich g ives n  

M
O
E


*
n 1
2
Good news: we have an equation
 Bad news:

1. Need to know s
2. We don’t know n so we don’t know the
degrees of freedom to find t*n-1
A Way Around this Problem:
Use the Standard Normal
*
U se the corresponding z from the standard norm al
to form the equation
 s 
MOE  z 

n


*
S olve for n:
 z s 
n

M
O
E


*
2
Sampling distribution of y
Confidence level
.95
  1.96


  1.96
n
n
MOE
MOE
set M O E  1.96

n
 1.96  
n

 MOE 

2
and solve for n
Estimating s
Previously collected data or prior
knowledge of the population
 If the population is normal or nearnormal, then s can be conservatively
estimated by
s  range
6
 99.7% of obs. Within 3  of the mean

Example: sample size to
 z s 
estimate mean height µ of
n  

MOE 

NCSU undergrad. male
students
We want to be 95% confident that we are
within .5 inch of , so
*
 MOE = .5; z*=1.96
Suppose previous data indicates that s
is about 2 inches.
 n= [(1.96)(2)/(.5)]2 = 61.47
 We should sample 62 male students

2
Example: Sample Size to
Estimate a Population Mean Textbooks

Suppose the financial aid office wants to
estimate the mean NCSU semester textbook
cost  within MOE=$25 with 98% confidence.
How many students should be sampled?
Previous data shows  is about $85.
2
2
 z *σ 
 (2 .3 3 )(8 5 ) 
n  
  
  6 2 .7 6
25


 MOE 
ro u n d u p to n = 6 3
Example: Sample Size to Estimate a Population
Mean -NFL footballs



The manufacturer of NFL footballs uses a machine to
inflate new footballs
The mean inflation pressure is 13.5 psi, but
uncontrollable factors cause the pressures of
individual footballs to vary from 13.3 psi to 13.7 psi
After throwing 6 interceptions in a game, Peyton
Manning complains that the balls are not properly
inflated.
The manufacturer wishes to estimate the
mean inflation pressure to within .025 psi
with a 99% confidence interval. How many
footballs should be sampled?
Example: Sample Size to Estimate
a Population Mean 




 z * 
n  

 MOE 
The manufacturer wishes to estimate the mean
inflation pressure to within .025 pound with a 99%
confidence interval. How may footballs should be
sampled?
99% confidence  z* = 2.58; MOE = .025
 = ? Inflation pressures range from 13.3 to 13.7 psi
So range =13.7 – 13.3 = .4;   range/6 = .4/6 = .067
2
 2 . 58  . 067 
n
  47 . 8  48
. 025


. . .
1
2
3
48
2
Required Sample Size To
Estimate a Population Mean 
T he form ula
 z s 
n

 MOE 
*
2
assum es an infinite population or
sam pling w ith replacem ent (so no fpc).

It is frequently the case that we are
sampling without replacement.
Required Sample Size To Estimate a
Population Mean  When Sampling
Without Replacement.
(1   )% c o n fid e n c e in te rv a l:
y  t
2
, n 1

1 

n  s2

N  n
C a n 't u s e s in c e d o n 't k n o w n ; u s e
y  z
2
y  z
2

1 


1 

n  s2

N  n
n  s2

N  n
MOE
Required Sample Size To Estimate a
Population Mean  When Sampling
Without Replacement.
y  z
2

n  s
1 

N

 n
2
MOE
2
n  s

1



N

 n
M O E  z
2
n
1
z
s
N
n 
MOE
2
n 
z s
2
(M OE )
2
n 

1 
 
N 

Required Sample Size To Estimate a
Population Mean  When Sampling
Without Replacement.
2
n 
z s
2
(M OE )
2
2
z s
2
 MOE
n 
1
n 
n 

1 
 
N 

2
2
1
z s
N
 MOE 
n0
1

2
n0
N
2
2
w h e re n 0 
z s
2
(M OE )
2
4.3 Estimation of population total
S ince   N 
w e know that the estim ator of
 is N tim es the estim ator y of 
and M O E for estim ating the total is N
tim es the M O E for estim ating the m ean
4.3 Estimation of population total
n
N
ˆ  N y 

yi
i 1
n
 N  n 


 N 1  n
2
V (ˆ )  V ( N y )  N V ( y )  N
2
Vˆ (ˆ )  N
2
2
n s

1 

N  n

2
M arg in o f erro r (M O E )
2
t .0 2 5 , n  1
N
2
n s

o r 1 .9 6
1 

N  n

2
N
2
n s

1 

N  n

4.3 Estimation of population total

Estimate number of lakes in Minnesota, the “Land of
10,000 Lakes”.
Required Sample Size To
Estimate a Population Total
2
MOE  z
2
N
n s

1 

N  n

2
N
2
n 
z s
2
(M OE )
2
N
2
n 

1 

N 

n 
z s
2
2
 MOE 
2
1 N
z s
2
2
(M OE )
2
so n 
N n0
1  N n0
2
w h ere n 0 
z s
2
(M OE )
2
2
4.5 Estimation of
population proportion p



Interested in the proportion p of a population that has a
characteristic of interest.
Estimate p with a sample proportion.
http://packpoll.com/
4.5 Estimation of population proportion p

1 if item i has the characteristic of interest
T he data: y 
i
pˆ 
1
n
0 if item i does not have the characteris tic
n

y  y
i
i 1
n
U nderlying m odel: each y
B (1, p );
i

i 1
 
n
E
y
i 1
i
 
n
 np ; V
y
i 1
i
 np (1  p )
y
i
B ( n, p)
4.5 Estimation of population proportion p
pˆ 
1
n
n

i 1
 
 
    
    
n
y ; E
y
i
 np ; V
i
y
i 1
y
n
1
i 1
i
n
1
E
y
n
i 1
y
n

i
n

i
 np (1  p )
i 1
n
1
S o: E ( pˆ )  E
V ( pˆ )  V
n
i 1
n
1
V
y
2
n
i
i 1
i


np
 p
n
np (1  p )
2
n

p (1  p )
n
4.5 Estimation of population proportion p
Vˆ ( pˆ )

n  pˆ (1  pˆ )

1 

N  n 1

n  pˆ (1  pˆ )

M OE  z 1 

N  n 1

Required Sample Size To Estimate
a Population Proportion p When
Sampling Without Replacement.
ˆ 
S in c e p
1
n
n0
n 
1
n0
n

y i  y , w e c a n u s e s a m p le s iz e fo rm u la f o r  :
i 1
2
w h e re n 0 
z s
2
(M OE )
2
.
N
S in c e V ( y i )  
fo r s
2
2
 p (1  p ),
w e c a n u s e p (1  p )
(u s e p rio r in fo rm a tio n a b o u t p o r p 
1
2
)
4.6 Comparing Estimates
W e often like to com pare the m eans  1 and  2
in different populations or the proportio ns p1 and p 2 .
T o com pare  1 and  2 w e estim ate the difference
1   2 .
T o com pare p1 and p 2 w e estim ate the difference
p1  p 2 .
4.6 Comparing Estimates:
Comparing Means
B ack g ro u n d : fo r ran d o m variab les X an d Y :
 E ( X  Y )  E ( X )  E (Y )   X   Y
V ( X  Y )  V ( X )  V (Y )  2 C o v( X , Y )
If X an d Y are in d ep en d en t, th en C o v ( X , Y )  0;
(w e w ill fo cu s o n th e in d ep en d en t case)
4.6 Comparing Estimates:
Comparing Means
x1 , x 2 ,
, x n1 ran d o m sam p le fro m p o p . 1 (  1 ,  1 u n k n o w n )
y1 , y 2 ,
, y n 2 ran d o m sam p le fro m p o p . 2 (  2 ,  2 u n k n o w n )
in d ep en d en t ran d o m sam p les fro m th e 2 p o p u latio n s
 E ( x  y )  E ( x )  E ( y )  1   2
V ( x  y )  V ( x )  V ( y )
2
2




n
s
n
s
Vˆ ( x )   1  1  1 ; Vˆ ( y )   1  2  2
N 1  n1
N 2  n2


Population 1
Parameters: µ1 and 12
(values are unknown)
Sample size: n1
Statistics: x1 and s12
Population 2
Parameters: µ2 and 22
(values are unknown)
Sample size: n2
Statistics: x2 and s22
Estimate µ1 µ2 with x1 x2
60
Sampling distribution model for
E ( x1  x 2 )   1   2 ; SD ( x1  x 2 ) 
( x1  x 2 )  ( 1   2 )

2
1
n1


x1  x 2
2
2
2
s1
SE ( x1  x 2 ) 
n2
2

n1
fpc: SE ( x1  x 2 ) 
S E ( x1  x 2 )
?

1 

n1
N1




 1 

2
s1
n1
s2
n2
n2
N2



2
s2
n2
Shape?
s
s 



n
n
 1
2 
2
1
df 
2
2
2
2
df
s 
1 s 
  
 
n1  1  n1 
n2  1  n2 
1
2
1
2
2
2
An estimate of the degrees of
freedom is
min(n1 − 1, n2 − 1).
2
s1
n1
2

s2
n2

0
( x1  x 2 )  (  1   2 )
SE ( x1  x 2 )
4.6 Comparing Estimates:
Comparing Means
B o u n d o n th e erro r o f estim atio n :
 t
2
, df
2
2


n1  s1
n2  s2
 1 
1 


N
n
N
n2

1 
1

2 
or
 z
2
2


n1  s1
n2  s2
 1 
1 


N 1  n1 
N 2  n2

4.6 Comparing Estimates: Comparing
Means (Special Case, Seldom Used)
A ssu m e  1   2   .
2
2
2
P o o led estim ate o f co m m o n varian ce:
( n1  1) s1  ( n 2  1) s 2
2
sp 
2
2
n1  n 2  2
;
V ( x  y )  V ( x )  V ( y ) 

2
n1
t 
( x1  x 2 )  (  1   2 )
s
2
p
n1

s
2
p


2
n2
BOE:
, d f  n1  n 2  2
2
t
2
, n1  n 2  2
2

n1  s p 
n2  s p
1


1





N
n
N
n2

1 
1

2 
or
n2
2
p
2
p


n1  s
n2  s
ˆ
ˆ
V ( x )  1 
;V ( y )   1 


N
n
N
n2

1 
1

2 
2
z
2

n1  s p 
n2  s p
 1 
1 


N
n
N
n2

1 
1

2 
4.6 Comparing Estimates: Comparing
Proportions, Two Cases
Difference between
two polls

Difference of proportions
between 2 independent polls
Differences within a single
poll question

Comparing proportions for a
single poll question, horse-race
polls (dependent proportions)
4.6 Comparing Estimates: Comparing
Proportions in Two Independent Polls
pˆ 1 estim ates pop. proportion p1 in poll #1
pˆ 2 estim ates pop. proportion p 2 in poll #2
P olls are independent
V ( pˆ 1  pˆ 2 )  V ( pˆ 1 )  V ( pˆ 2 )

p1 (1  p1 )
n1

p 2 (1  p 2 )
n2
4.6 Comparing Estimates: Comparing
Proportions in Two Independent Polls
Vˆ ( pˆ 1  pˆ 2 )  Vˆ ( pˆ 1 )  Vˆ ( pˆ 2 )

n1  pˆ 1 (1  pˆ 1 ) 
n 2  pˆ 2 (1  pˆ 2 )
 1 
 1 


N 1  n1  1
N 2  n2  1



n1  pˆ 1 (1  pˆ 1 ) 
n 2  pˆ 2 (1  pˆ 2 )
BOE : z 1 
 1 


N 1  n1  1
N 2  n2  1


4.6 Comparing Estimates: Comparing
Dependent Proportions in a Single Poll
 Multinomial Sampling Situation
– Typically 3 or more choices in a poll
V ( pˆ 1  pˆ 2 )

( p1  p 2 )  ( p1  p 2 )
 V ( pˆ 1 )  V ( pˆ 2 )  2
2
n
p1 p 2
n
pˆ 1 pˆ 2
ˆ
ˆ
ˆ
V ( pˆ 1  pˆ 2 )  V ( pˆ 1 )  V ( pˆ 2 )  2
n 1

n  pˆ 1 (1  pˆ 1 ) 
n  pˆ 2 (1  pˆ 2 )
pˆ 1 pˆ 2
 1 
 1 
2


N  n 1
N  n 1
n 1


Worksheet

http://packpoll.com/
End of Chapter 4
Download