Proportion and Confidence Intervals

Random Sampling
Find a random number
On main enter
rand(
repeat
What happened ? Give a definition of rand()
Psuedo random number
If you selected 100 random numbers what would histogram look like ?
In statistics
In list 1
in Cal enter
On Spread Sheet
In A1 enter
=rand(
randList (100) exe
and draw histogram
Fill – Fill range (A1:A100)
draw histogram
Select 10 random numbers and add them and repeat 30 times
On Spread Sheet
In A1 enter
rand(
Fill – Fill range (A1:J30)
In K1 enter
calc List-calculation
Sum
Highlight K1 Fillrange (K1:K30)
Highlight K
and draw histogram
Edit
Recalculate
(A1:J1)
recalculate
To find random number, x
0 ≤ x≤ 8
rand()  8
To find random integer x,
0 ≤ x≤ 8
int(rand()  8 + 1 )

(rand(1,8 )
Simulations

Draw a histogram obtained
if a single die is rolled 120 times
Spread sheet in A1 enter =int(rand()6+1) exe
Fill A1:A120 Highlight column A draw histogram.

How many 6’s would you expect if you rolled a single die 120 times.
On a spread sheet
The 120 rolls of the die are already in Column A
In B1 enter
Calc Cell-Calculation
Cellif
In C1 enter
Calc List-Calculations
Sum
Graph histogram
Enter
Enter
A1=6,1,0
B1:B120
Fillrange
B1:B120
Sampling Distributions
Example 1
Select a smartie from a box containing 10 smarties, 3 of which are blue. Replace the smartie
and repeat the experiment 10 times. Record the number of blue smarties for the 10
experiments.
This is a Bernoulli trial. Record the theoretical probabilities on the table.
X
0
1
2
3
4
5
6
7
8
9
10
𝑝̂
0
10
1
10
2
10
3
10
4
10
5
10
6
10
7
10
8
10
9
10
10
10
P(𝑃̂ = 𝑝̂ )
To find the theoretical probabilities
P (x=n) = 10Cn (0.3)n (0.7)10-n
Method 1
Use Main
For zero blue smarties.
P (x=0) = 10C0 (0.3)0 (0.7)10
To find the other probabilities for values of x for 1 ≤ x ≤ 10
Edit 0  r to 1  r Exe
And repeat for r = 2 to 10
Method 2
Use Statistics
Statistics
Calc
Distributions
Binomial PD
Next
x = 0 , Numtrial = 10 , p = 0.3
Next select graph icon
Use arrow > to find other values
Method 3
Use Graph& table
To obtain a table of results Keyboard
B
binomialPDf
input
in bracket enter (x,10,0.3)
set table to start 0 , end 10 & step
Graph results as scatter plot
catalogue
Simulation of the above experiment thirty times
Spreadsheet
In cell A1 enter a pseudo random number to simulate the selection of a blue/non blue
Int(rand()+0.3)  0 not blue , 1 blue
Edit to select experiment 30 times.
Edit Fill Fillrange A1:J30
(note: the 10 draws go across the spread sheet)
Calculate the number of “Blue smarties” from 30 draws
In K1 enter Calc List-Calc
Sum
A1:J1 Exe
Edit
Fill
Fillrange
K1:K30
Exe
Draw histogram of doing the experiment 30 times.
Use calc the find the mean and standard deviation
of the results
Mean =
standard deviation =
Repeat a number of times
Edit recalculate
For each the ten selections calculate 𝑝̂ (sample proportion) (in column L)
For the 30 samples of 𝑝̂ calculate the mean and the standard deviation
Compare the result
Proportion and Confidence Intervals
Sampling unknown proportion
A 380 g bag of smarties contains 352 smarties of which 43 are blue
43
 Sample proportion 𝑝̂ = 352  0.12
Consider the actual proportion = ?
We consider 𝑝̂ to be normally distributed
Consider 90% confidence level
Our result of
𝑝̂  0.12 could be the worst case scenario or the best case scenario
i.e
0.092
0.12
𝑝̂  0.12
To find the 90% confidence interval
( 𝑝̂ )  1.64  sd (𝑝̂ )
0.092 ≤ p ≤ 0.148
0.148
note: 𝑝̂ = 0.12
SD =√
0.12 ×0.88
352
= 0.017
( to 3 decimal places )
Alternative methods
1. Statistics
Confidence interval
1. Statistics
Confidence interval
Calc
Inv Dist
Inv Normal CD
center prob = 0.9, sd= 0.017, 𝑝̂ = 0.12
0.092 – 0.148
Calc
Interval
0.093 – 0.151
One-prop Z int
c-level = 0.90
x = number blue smarties = 43
n = total number smarties=352