Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing...

199
Last Time • Hypothesis Testing – 1-sided vs. 2-sided Paradox • Big Picture Goals – Hypothesis Testing – Margin of Error – Sample Size Calculations • Visualization – Histograms

Transcript of Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing...

Page 1: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Last Time

• Hypothesis Testing– 1-sided vs. 2-sided Paradox

• Big Picture Goals– Hypothesis Testing– Margin of Error– Sample Size Calculations

• Visualization– Histograms

Page 2: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Administrative Matters

Midterm I, coming Tuesday, Feb. 24

• Excel notation to avoid actual calculation– So no computers or calculators

• Bring sheet of formulas, etc.

Page 3: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Administrative Matters

Midterm I, coming Tuesday, Feb. 24

• Excel notation to avoid actual calculation– So no computers or calculators

• Bring sheet of formulas, etc.

• No blue books needed

Page 4: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Administrative Matters

Midterm I, coming Tuesday, Feb. 24

• Excel notation to avoid actual calculation– So no computers or calculators

• Bring sheet of formulas, etc.

• No blue books needed

(will just write on my printed version)

Page 5: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Administrative Matters

Midterm I, coming Tuesday, Feb. 24

• Material Covered:

HW 1 – HW 5

Page 6: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Administrative Matters

Midterm I, coming Tuesday, Feb. 24

• Material Covered:

HW 1 – HW 5

– Note: due Thursday, Feb. 19

Page 7: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Administrative Matters

Midterm I, coming Tuesday, Feb. 24

• Material Covered:

HW 1 – HW 5

– Note: due Thursday, Feb. 19– Will ask grader to return Mon. Feb. 23

Page 8: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Administrative Matters

Midterm I, coming Tuesday, Feb. 24

• Material Covered:

HW 1 – HW 5

– Note: due Thursday, Feb. 19– Will ask grader to return Mon. Feb. 23– Can pickup in my office (Hanes 352)

Page 9: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Administrative Matters

Midterm I, coming Tuesday, Feb. 24

• Material Covered:

HW 1 – HW 5

– Note: due Thursday, Feb. 19– Will ask grader to return Mon. Feb. 23– Can pickup in my office (Hanes 352)– So today’s HW not included

Page 10: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Reading In Textbook

Approximate Reading for Today’s Material:

Pages 261-262, 9-14, 270-276, 30-34

Approximate Reading for Next Class:

Pages 279-282, 34-43

Page 11: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Big Picture

• Hypothesis Testing

(Given dist’n, answer “yes-no”)

• Margin of Error

(Find dist’n, use to measure error)

• Choose Sample Size

(for given amount of error)

Need better prob. tools

Page 12: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Big Picture

• Margin of Error

• Choose Sample Size

Need better prob tools

Start with visualizing probability distributions

(key to “alternate representation”)

Page 13: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

Idea: show rectangles, where area represents

Page 14: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

Idea: show rectangles, where area represents:

(a) Distributions: probabilities

(b) Lists (of numbers): # of observations

Page 15: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

Idea: show rectangles, where area represents:

(a) Distributions: probabilities

(b) Lists (of numbers): # of observations

Note: will studies these in parallel for a while

(several concepts apply to both)

Page 16: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

Idea: show rectangles, where area represents:

(a) Distributions: probabilities

(b) Lists (of numbers): # of observations

Caution: There are variations not based on

areas, see bar graphs in text

But eye perceives area, so sensible to use it

Page 17: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

Steps for Constructing Histograms:

1. Pick class intervals that contain full dist’n

Page 18: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

Steps for Constructing Histograms:

1. Pick class intervals that contain full dist’n

a. Prob. dist’ns:

If possible values are: x = 0, 1, … , n,

get good picture from choice:

[-½, ½), [½, 1.5), [1.5, 2.5), … , [n-½, n+½)

where [1.5, 2.5) is “all #s ≥ 1.5 and < 2.5”

(called a “half open interval”)

Page 19: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

Steps for Constructing Histograms:

1. Pick class intervals that contain full dist’n

a. Prob. dist’ns

b. Lists: e.g. 2.3, 4.5, 4.7, 4.8, 5.1

Start with [1,3), [3,7)

• As above use half open intervals

(to break ties)

Page 20: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

Steps for Constructing Histograms:

1. Pick class intervals that contain full dist’n

a. Prob. dist’ns

b. Lists: e.g. 2.3, 4.5, 4.7, 4.8, 5.1

Start with [1,3), [3,7)

• Can use anything for class intervals

• But some choices better than others…

Page 21: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

Steps for Constructing Histograms:

1. Pick class intervals that contain full dist’n

2. Find “probabilities” or “relative frequencies”

for each class

(a) Probs: use f(x) for [x-½, x+½), etc.

(b) Lists: [1,3): rel. freq. = 1/5 = 20%

[3,7): rel. freq. = 4/5 = 80%

Page 22: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

Steps for Constructing Histograms:

1. Pick class intervals that contain full dist’n

2. Find “probabilities” or “relative frequencies”

for each class

3. Above each interval, draw rectangle where

area represents class frequency

Page 23: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

3. Above each interval, draw rectangle where

area represents class frequency

(a) Probs: If width = 1, then

area = width x height = height

So get area = f(x), by taking height = f(x)

Page 24: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

3. Above each interval, draw rectangle where

area represents class frequency

(a) Probs: If width = 1, then

area = width x height = height

So get area = f(x), by taking height = f(x)

E.g. Binomial Distribution

Page 25: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Binomial Prob. Histograms

From Class Example 5http://www.stat-or.unc.edu/webspace/courses/marron/UNCstor155-2009/ClassNotes/Stor155Eg5.xls

Construct Prob. Histo:

• Create column of x values

• Compute f(x) values

• Make bar plot

Page 26: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Binomial Prob. Histograms• Make bar plot

– “Insert” tab– Choose “Column”– Right Click – Select Data

(Horizontal – x’s, “Add series”, Probs)– Resize, and move by dragging– Delete legend– Click and change title– Right Click on Bars, Format Data Series:

• Border Color, Solid Line, Black• Series Options, Gap Width = 0

Page 27: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Binomial Prob. Histograms

From Class Example 5http://www.stat-or.unc.edu/webspace/courses/marron/UNCstor155-2009/ClassNotes/Stor155Eg5.xls

Construct Prob. Histo:

• Create column of x values

• Compute f(x) values

• Make bar plot

• Make several, for interesting comparison

Page 28: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Binomial Prob. Histograms

From Class Example 5a

Page 29: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Binomial Prob. Histograms

From Class Example 5a

Compare

Different p

Page 30: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Binomial Prob. HistogramsFrom Class Example 5a

Compare

Different p:

• Surprisingly

similar

“mound”

shape

Page 31: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Binomial Prob. HistogramsFrom Class Example 5a

Compare

Different p:

• Surprisingly

similar

“mound”

shape

(will exploit this fact)

Page 32: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Binomial Prob. Histograms

From Class Example 5a

Compare

Different p:

• Centerpoint

moves

as p grows

Page 33: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Binomial Prob. HistogramsFrom Class Example 5a

Compare

Different p:

• Centerpoint

moves

as p grows

(will quantify, and use this, too)

Page 34: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Binomial Prob. Histograms

Important point:

Binomial shows common shape across p

Page 35: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Binomial Prob. Histograms

Important point:

Binomial shows common shape across p

Mound Shape

(like dumping dirt out of a truck)

Page 36: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Binomial Prob. Histograms

Important point:

Binomial shows common shape across p

Mound Shape

(like dumping dirt out of a truck)

What about n?

Page 37: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Binomial Prob. Histograms

From Class Example 5b

Compare

Different n

Page 38: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Binomial Prob. HistogramsFrom Class Example 5b

Compare

Different n:

• Again very

similar

mound

shape

Page 39: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Binomial Prob. HistogramsFrom Class Example 5b

Compare

Different n:

• Again very

similar

mound

shape

(will exploit this fact)

Page 40: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Binomial Prob. Histograms

From Class Example 5b

Compare

Different n:

• Center does

not appear

to move

Page 41: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Binomial Prob. Histograms

From Class Example 5b

Compare

Different n:

• Center does

not appear

to move,

but check axes!

Page 42: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Binomial Prob. Histograms

From Class Example 5b

Compare

Different n:

• Center does

not appear

to move,

but check axes!

(will quantify, and use this, too)

Page 43: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Binomial Prob. Histograms

From Class Example 5b

Compare

Different n:

• But width of

bump does

seem to

change

Page 44: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Binomial Prob. HistogramsFrom Class Example 5b

Compare

Different n:

• But width of

bump does

seem to

change

(will quantify, and use this, too)

Page 45: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Binomial Prob. Histograms

Important point:

Binomial shows common shape across p & n

Mound Shape

(like dumping dirt out of a truck)

Page 46: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Binomial Prob. Histograms

Important point:

Binomial shows common shape across p & n

Mound Shape

(like dumping dirt out of a truck)

Question for later: How can we put this work?

Page 47: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

And now for something (sort of) different

Recall survey from first class meeting

Page 48: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

And now for something (sort of) different

Recall survey from first class meeting

Display Results?

Page 49: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

And now for something (sort of) different

Recall survey from first class meeting

Display Results? Use “bar graph”

Page 50: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

And now for something (sort of) different

Bar Graph from Survey, on major

Page 51: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

And now for something (sort of) different

Bar Graph from Survey, on major Business

biggest (true for many years)

Page 52: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

And now for something (sort of) different

Bar Graph from Survey, on major Business

biggestBiology 2nd (fairly new)

Page 53: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

And now for something (sort of) different

Bar Graph from Survey, on major Business

biggestBiology 2nd Variety of others

Welcome!

Page 54: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

And now for something (sort of) different

Bar Graph from Survey, on major

Labels, notClass Intervals

Page 55: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

And now for something (sort of) different

Bar Graph from Survey, on major

Thin bars Now OK

Page 56: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

And now for something (sort of) different

Bar Graph from Survey, on major

Study Counts, not rel. freq.

Page 57: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

And now for something (sort of) different

Bar Graph from Survey, on major

Study Counts, not rel. freq. (not areas)

Page 58: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

And now for something (sort of) different

Bar Graph from Survey, on year

Page 59: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

And now for something (sort of) different

Bar Graph from Survey, on year

Distributionmakes sense?

Page 60: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

And now for something (sort of) different

Bar Graph from Survey, on year

Different color stresses different data

Page 61: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

And now for something (sort of) different

Bar Graph from Survey, on year

Shorter & fewer labels appear as horizontal

Page 62: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

Steps for Constructing Histograms:

1. Pick class intervals that contain full dist’n

2. Find “probabilities” or “relative frequencies”

for each class

3. Above each interval, draw rectangle where

area represents class frequency

Page 63: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

HW: 5.21b (make & print an Excel plot)

Page 64: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

3. Above each interval, draw rectangle where

area represents class frequency

(a) Probs

Page 65: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

3. Above each interval, draw rectangle where

area represents class frequency

(a) Probs

(b) Lists

Page 66: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

3. Above each interval, draw rectangle where

area represents class frequency

(a) Probs

(b) Lists: e.g. 2.3, 4.5, 4.7, 4.8, 5.1

same e.g. as above

Page 67: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

3. Above each interval, draw rectangle where

area represents class frequency

(a) Probs

(b) Lists: e.g. 2.3, 4.5, 4.7, 4.8, 5.1

Page 68: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

Rectangles - area represents class frequency

2.3, 4.5, 4.7, 4.8, 5.1

1 2 3 4 5 6 7

Page 69: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

Rectangles - area represents class frequency

2.3, 4.5, 4.7, 4.8, 5.1, Class Intervals [1,3), [3,7)

1 2 3 4 5 6 7

Page 70: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

Rectangles - area represents class frequency

2.3, 4.5, 4.7, 4.8, 5.1, Class Intervals [1,3), [3,7)

From above discussion

1 2 3 4 5 6 7

Page 71: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

Rectangles - area represents class frequency

2.3, 4.5, 4.7, 4.8, 5.1, Class Intervals [1,3), [3,7)

From above discussion

(will see: not very good)

1 2 3 4 5 6 7

Page 72: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

Rectangles - area represents class frequency

2.3, 4.5, 4.7, 4.8, 5.1, Class Intervals [1,3), [3,7)

1 2 3 4 5 6 7

Page 73: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

Rectangles - area represents class frequency

2.3, 4.5, 4.7, 4.8, 5.1, Class Intervals [1,3), [3,7)

1 2 3 4 5 6 7

Page 74: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

Rectangles - area represents class frequency

2.3, 4.5, 4.7, 4.8, 5.1, Class Intervals [1,3), [3,7)

20 Total Frequency = 100%

15

10

5

1 2 3 4 5 6 7

Page 75: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

Rectangles - area represents class frequency

2.3, 4.5, 4.7, 4.8, 5.1, Class Intervals [1,3), [3,7)

20 Total Frequency = 100%

15 So each is 20%

10

5

1 2 3 4 5 6 7

Page 76: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

Rectangles - area represents class frequency

2.3, 4.5, 4.7, 4.8, 5.1, Class Intervals [1,3), [3,7)

20 Total Frequency = 100%

15 20% = Area

10

5

1 2 3 4 5 6 7

Page 77: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

Rectangles - area represents class frequency

2.3, 4.5, 4.7, 4.8, 5.1, Class Intervals [1,3), [3,7)

20 Total Frequency = 100%

15 20% = Area = 2 * height

10

5

1 2 3 4 5 6 7

Page 78: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

Rectangles - area represents class frequency

2.3, 4.5, 4.7, 4.8, 5.1, Class Intervals [1,3), [3,7)

20 Total Frequency = 100%

15 20% = Area = 2 * ht = 2 * (10% / unit)

10

5

1 2 3 4 5 6 7

Page 79: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

Rectangles - area represents class frequency

2.3, 4.5, 4.7, 4.8, 5.1, Class Intervals [1,3), [3,7)

20 Total Frequency = 100%

15 20% = Area = 2 * ht = 2 * (10% / unit)

10

5

1 2 3 4 5 6 7

% p

er u

nit

Page 80: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

Rectangles - area represents class frequency

2.3, 4.5, 4.7, 4.8, 5.1, Class Intervals [1,3), [3,7)

20 Total Frequency = 100%

15 20% = Area = 4 * ht

10

5

1 2 3 4 5 6 7

% p

er u

nit

Page 81: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

Rectangles - area represents class frequency

2.3, 4.5, 4.7, 4.8, 5.1, Class Intervals [1,3), [3,7)

20 Total Frequency = 100%

15 20% = Area = 4 * ht = 4 * (5% / unit)

10

5

1 2 3 4 5 6 7

% p

er u

nit

Page 82: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

Rectangles - area represents class frequency

2.3, 4.5, 4.7, 4.8, 5.1, Class Intervals [1,3), [3,7)

20 Total Frequency = 100%

15 20% = Area = 4 * ht = 4 * (5% / unit)

10

5

1 2 3 4 5 6 7

% p

er u

nit

Page 83: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

Rectangles - area represents class frequency

2.3, 4.5, 4.7, 4.8, 5.1, Class Intervals [1,3), [3,7)

20 20% = Area = 4 * ht = 4 * (5% / unit)

15

10

5

1 2 3 4 5 6 7

% p

er u

nit

Page 84: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

Rectangles - area represents class frequency

2.3, 4.5, 4.7, 4.8, 5.1, Class Intervals [1,3), [3,7)

20

15

10

5

1 2 3 4 5 6 7

% p

er u

nit

Page 85: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

Note: This histogram hides structure in data:

2.3, 4.5, 4.7, 4.8, 5.1

20

15

10

5

1 2 3 4 5 6 7

% p

er u

nit

Page 86: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

Quite sparse region

2.3, 4.5, 4.7, 4.8, 5.1

20

15

10

5

1 2 3 4 5 6 7

% p

er u

nit

Page 87: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

Quite dense region

2.3, 4.5, 4.7, 4.8, 5.1

20

15

10

5

1 2 3 4 5 6 7

% p

er u

nit

Page 88: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

Endpoints way off

2.3, 4.5, 4.7, 4.8, 5.1

20

15

10

5

1 2 3 4 5 6 7

% p

er u

nit

Page 89: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

General Major Challenge:

Choice of Class Intervals

20

15

10

5

1 2 3 4 5 6 7

% p

er u

nit

Page 90: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

Try for “better” choice:

2.3, 4.5, 4.7, 4.8, 5.1

1 2 3 4 5 6 7

Page 91: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

Try for “better” choice:

2.3, 4.5, 4.7, 4.8, 5.1

[2,4)

[4,5)

[5,6)

1 2 3 4 5 6 7

Page 92: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

Now build histogram as above (areas):

2.3, 4.5, 4.7, 4.8, 5.1

60

30

1 2 3 4 5 6 7

% p

er u

nit

Page 93: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

Now build histogram as above (areas):

2.3, 4.5, 4.7, 4.8, 5.1

60

30

1 2 3 4 5 6 7

% p

er u

nit

Page 94: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

Now build histogram as above (areas):

2.3, 4.5, 4.7, 4.8, 5.1

60

30

1 2 3 4 5 6 7

% p

er u

nit

Page 95: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

Now build histogram as above (areas):

2.3, 4.5, 4.7, 4.8, 5.1

60

30

1 2 3 4 5 6 7

% p

er u

nit

Page 96: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

Now build histogram as above (areas):

2.3, 4.5, 4.7, 4.8, 5.1

60

30

1 2 3 4 5 6 7

% p

er u

nit

Page 97: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

Note: much better visual impression

2.3, 4.5, 4.7, 4.8, 5.1

60

30

1 2 3 4 5 6 7

% p

er u

nit

Page 98: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

Note: much better visual impression

Histogram better reflects “structure in data”

60

30

1 2 3 4 5 6 7

% p

er u

nit

Page 99: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

General Comments:

• Total area under histogram is 100%

Page 100: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

General Comments:

• Total area under histogram is 100%

• So label vertical axis as “% per unit”

Page 101: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

General Comments:

• Total area under histogram is 100%

• So label vertical axis as “% per unit”

• Synonym for “Class Interval” is “bin”

Page 102: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

General Comments:

• Total area under histogram is 100%

• So label vertical axis as “% per unit”

• Synonym for “Class Interval” is “bin”

(think of relative frequency as counting

observations that “fall into bins”)

Page 103: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

General Comments:

• Total area under histogram is 100%

• So label vertical axis as “% per unit”

• Synonym for “Class Interval” is “bin”

(think of relative frequency as counting

observations that “fall into bins”)

• Choice of bins is critical

Page 104: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

General Comments:

• Total area under histogram is 100%

• So label vertical axis as “% per unit”

• Synonym for “Class Interval” is “bin”

(think of relative frequency as counting

observations that “fall into bins”)

• Choice of bins is critical

• Common Simplification: Equally spaced

Page 105: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

General Comments:

• Choice of bins is critical

• Common Simplification: Equally spaced

• But still have choice of binwidth

(also very challenging)

Page 106: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

HW: C15 For the data:

0.8, 2.1, 2.6, 0.9, 2.2, 0.8, 2.2, 0.9

a) Make histograms using the bins:

i. [0,1), [1,2), [2,3)

ii. [0.5,1.5), [1.5,2.5), [2.5,3.5)

iii. [0,1), 1,3)

(Interesting to look at differences)

Page 107: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histograms

HW: C15 For the data:

0.8, 2.1, 2.6, 0.9, 2.2, 0.8, 2.2, 0.9

a) Make histograms using the bins:

i. [0,1), [1,2), [2,3)

ii. [0.5,1.5), [1.5,2.5), [2.5,3.5)

iii. [0,1), 1,3)

b) Why are bins [0,2), [1,3) inappropriate here?

c) Why are bins [1,2), [2,5) inappropriate here?

Page 108: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data

• Annual totals (in inches)

Page 109: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data

• Annual totals (in inches)

• For Buffalo, N.Y.

Page 110: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data

• Annual totals (in inches)

• For Buffalo, N.Y.

• 63 years, ranging from ~30 to ~120

Page 111: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data

• Annual totals (in inches)

• For Buffalo, N.Y.

• 63 years, ranging from ~30 to ~120

• A lot of snow, due to “lake effect”

Page 112: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data

• Annual totals (in inches)

• For Buffalo, N.Y.

• 63 years, ranging from ~30 to ~120

• A lot of snow, due to “lake effect”

• Any patterns in data?

Page 113: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data

• Data Available in Class Example 6

• Left hand column of spreadsheet:http://www.stat-or.unc.edu/webspace/courses/marron/UNCstor155-2009/ClassNotes/Stor155Eg6.xls

Page 114: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data

• Data Available in Class Example 6

• Left hand column of spreadsheet:http://www.stat-or.unc.edu/webspace/courses/marron/UNCstor155-2009/ClassNotes/Stor155Eg6.xls

• Now do histogram analysis

• Using Excel

Page 115: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data – Excel Default Histo

• Data Tab

Page 116: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data – Excel Default Histo

• Data Tab

• Push Data Analysis Button

Page 117: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data – Excel Default Histo

• Data Tab

• Push Data Analysis Button

• Pulls up:

Page 118: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data – Excel Default Histo

• Data Tab

• Push Data Analysis Button

• Pulls up:

• Choose:

Page 119: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data – Excel Default Histo

• Pulls Up:

Page 120: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data – Excel Default Histo

• Pulls Up:

• Link input data

Page 121: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data – Excel Default Histo

• Pulls Up:

• Link input data

• Empty for default

Page 122: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data – Excel Default Histo

• Pulls Up:

• Link input data

• Empty for default

• Choose here

Page 123: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data – Excel Default Histo

• Pulls Up:

• Link input data

• Empty for default

• Choose here

• And location

Page 124: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data – Excel Default Histo

• Pulls Up:

• Link input data

• Empty for default

• Choose here

• And location

• Get Histo Plot

Page 125: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data – Excel Default Histo

• Manually Chart Result???

Page 126: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data – Excel Default Histo

• Manually Chart Result???

• Twiddle Output (similar to above):

• Delete Series Legend

Page 127: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data – Excel Default Histo

• Manually Chart Result???

• Twiddle Output (similar to above):

• Delete Series Legend

• Format Data Series – Gap Width 0

Page 128: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data – Excel Default Histo

• Manually Chart Result???

• Twiddle Output (similar to above):

• Delete Series Legend

• Format Data Series – Gap Width 0

• Format Data Series – Border Color Black

Page 129: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data – Excel Default Histo

• Manually Chart Result???

• Twiddle Output (similar to above):

• Delete Series Legend

• Format Data Series – Gap Width 0

• Format Data Series – Border Color Black

• Chart Tools – Design – Choose Titled

Page 130: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data – Excel Default Histo

• Manually Chart Result???

• Twiddle Output (similar to above):

• Delete Series Legend

• Format Data Series – Gap Width 0

• Format Data Series – Border Color Black

• Chart Tools – Design – Choose Titled

• Type in Title

Page 131: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data – Excel Default Histo

• Result:

Page 132: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data – Excel Default Histo

• Result:

• Unround numbers

for bin edges

Page 133: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data – Excel Default Histo

• Result:

• Unround numbers

for bin edges

• Hard to interpret

Page 134: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data – Excel Default Histo

• Data centered

around 90

Page 135: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data – Excel Default Histo

• Data centered

around 90

• Most data between

50 and 130

Page 136: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data – Excel Default Histo

• Data centered

around 90

• Most data between

50 and 130

• Assymetric

Distribution

Page 137: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data – Smaller binwidth

Page 138: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data – Smaller binwidth

Page 139: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data – Smaller binwidth

• Chosen by me

• Binwidth = 5, << ~13 from EXCEL default

Page 140: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data – Smaller binwidth

• Chosen by me

• Binwidth = 5, << ~13 from EXCEL default

• Nicer edge numbers

Page 141: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data – Smaller binwidth

• Chosen by me

• Binwidth = 5, << ~13 from EXCEL default

• Nicer edge numbers• Data centered around 84 (now more precise)

Page 142: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data – Smaller binwidth

• Chosen by me

• Binwidth = 5, << ~13 from EXCEL default

• Nicer edge numbers• Data centered around 84 (now more precise)

• Bar graph rougher (fewer points in each bin)

Page 143: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data – Smaller binwidth

• Chosen by me

• Binwidth = 5, << ~13 from EXCEL default

• Nicer edge numbers• Data centered around 84 (now more precise)

• Bar graph rougher (fewer points in each bin)

• Suggests 3 main groups

Page 144: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data – Smaller binwidth

• Chosen by me

• Binwidth = 5, << ~13 from EXCEL default

• Nicer edge numbers• Data centered around 84 (now more precise)

• Bar graph rougher (fewer points in each bin)

• Suggests 3 main groups

(called “modes” or “clusters”)

Page 145: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data – Smaller binwidth• Chosen by me• Binwidth = 5, << ~13 from EXCEL default• Nicer edge numbers• Data centered around 84 (now more precise)

• Bar graph rougher (fewer points in each bin)• Suggests 3 main groups

(called “modes” or “clusters”)

(can’t see this above: bin width is important)

Page 146: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data – Larger binwidth

Page 147: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data – Larger binwidth

Page 148: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data – Larger binwidth

• Chosen by me

• Binwidth = 30, >> ~13 from EXCEL default

Page 149: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data – Larger binwidth

• Chosen by me

• Binwidth = 30, >> ~13 from EXCEL default

• Bar graph is “smooth”

(since many points in each bin)

Page 150: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data – Larger binwidth

• Chosen by me

• Binwidth = 30, >> ~13 from EXCEL default

• Bar graph is “smooth”

(since many points in each bin)

• Only one mode (cluster)???

Page 151: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data – Larger binwidth

• Chosen by me

• Binwidth = 30, >> ~13 from EXCEL default

• Bar graph is “smooth”

(since many points in each bin)

• Only one mode (cluster)???

• Quite symmetric?

Page 152: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

Buffalo Snow Fall Data – Larger binwidth

• Chosen by me

• Binwidth = 30, >> ~13 from EXCEL default

• Bar graph is “smooth”

(since many points in each bin)

• Only one mode (cluster)???

• Quite symmetric?

(different from above: bin width is important)

Page 153: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Histogram Real Data Example

HW:

1.28 [data in ta01_005.xls]

((c) loses bump near 50)

1.36 [data in ex01_036.xls]

((a) 4 (b) 2 (c) 1)

1.37

1.39

Page 154: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Research Corner

Histo Bin Width (serious issue)Histo Bin Width (serious issue)

Page 155: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Research Corner

Histo Bin Width (serious issue)Histo Bin Width (serious issue)

Interesting Data Set: Hidalgo StampsInteresting Data Set: Hidalgo Stamps

Page 156: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Research Corner

Histo Bin Width (serious issue)Histo Bin Width (serious issue)

Interesting Data Set: Hidalgo StampsInteresting Data Set: Hidalgo Stamps

• Famous among postage stamp collectorsFamous among postage stamp collectors

Page 157: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Research Corner

Histo Bin Width (serious issue)Histo Bin Width (serious issue)

Interesting Data Set: Hidalgo StampsInteresting Data Set: Hidalgo Stamps

• Famous among postage stamp collectorsFamous among postage stamp collectors

• Printed in Mexico, 1800’s, over ~70 yearsPrinted in Mexico, 1800’s, over ~70 years

Page 158: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Research Corner

Histo Bin Width (serious issue)Histo Bin Width (serious issue)

Interesting Data Set: Hidalgo StampsInteresting Data Set: Hidalgo Stamps

• Famous among postage stamp collectorsFamous among postage stamp collectors

• Printed in Mexico, 1800’s, over ~70 yearsPrinted in Mexico, 1800’s, over ~70 years

• Very different paper thicknesses…Very different paper thicknesses…

Page 159: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Research Corner

Histo Bin Width (serious issue)Histo Bin Width (serious issue)

Interesting Data Set: Hidalgo StampsInteresting Data Set: Hidalgo Stamps

• Famous among postage stamp collectorsFamous among postage stamp collectors

• Printed in Mexico, 1800’s, over ~70 yearsPrinted in Mexico, 1800’s, over ~70 years

• Very different paper thicknesses…Very different paper thicknesses…

• How many paper sources?How many paper sources?

Page 160: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Research Corner

Histo Bin Width (serious issue)Histo Bin Width (serious issue)

Interesting Data Set: Hidalgo StampsInteresting Data Set: Hidalgo Stamps

• Famous among postage stamp collectorsFamous among postage stamp collectors

• Printed in Mexico, 1800’s, over ~70 yearsPrinted in Mexico, 1800’s, over ~70 years

• Very different paper thicknesses…Very different paper thicknesses…

• How many paper sources?How many paper sources?

• Unknown, since records are lostUnknown, since records are lost

Page 161: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Research Corner

Histo Bin Width (serious issue)Histo Bin Width (serious issue)

Interesting Data Set: Hidalgo StampsInteresting Data Set: Hidalgo Stamps

• Famous among postage stamp collectorsFamous among postage stamp collectors

• Printed in Mexico, 1800’s, over ~70 yearsPrinted in Mexico, 1800’s, over ~70 years

• Very different paper thicknesses…Very different paper thicknesses…

• How many paper sources?How many paper sources?

• Unknown, since records are lostUnknown, since records are lost

• Study histogram of stamp thicknessesStudy histogram of stamp thicknesses

Page 162: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Research Corner

Movie over binwidthMovie over binwidth

Page 163: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Research Corner

Movie over binwidthMovie over binwidth

Shows Shows veryvery wide range wide range

Page 164: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Research Corner

Movie over binwidthMovie over binwidth

Shows Shows veryvery wide range wide range

(much different(much different

visual impressions)visual impressions)

Page 165: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Research Corner

Movie over binwidthMovie over binwidth

Shows Shows veryvery wide range wide range

(much different(much different

visual impressions)visual impressions)

How many bumps?How many bumps?

Page 166: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Research Corner

Movie over binwidthMovie over binwidth

Shows Shows veryvery wide range wide range

(much different(much different

visual impressions)visual impressions)

How many bumps?How many bumps?

Answer published inAnswer published in

literature: 2, 3, 5, 7, 10literature: 2, 3, 5, 7, 10

Page 167: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Research Corner

Movie over binwidthMovie over binwidth

Shows Shows veryvery wide range wide range

(much different(much different

visual impressions)visual impressions)

How many bumps?How many bumps?

Answer published inAnswer published in

literature: 2, 3, 5, 7, 10literature: 2, 3, 5, 7, 10

Very challenging questionVery challenging question

Page 168: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Research Corner

How many bumps?How many bumps?

Believe in 2?Believe in 2?

Page 169: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Research Corner

How many bumps?How many bumps?

Believe in 3?Believe in 3?

Page 170: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Research Corner

How many bumps?How many bumps?

Believe in 5?Believe in 5?

Page 171: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Research Corner

How many bumps?How many bumps?

Believe in 7?Believe in 7?

Page 172: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Research Corner

How many bumps?How many bumps?

Believe in 10?Believe in 10?

Page 173: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Big Picture

• Margin of Error

• Choose Sample Size

Need better prob tools

Start with visualizing probability distributions

Page 174: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Big Picture

• Margin of Error

• Choose Sample Size

Need better prob tools

Start with visualizing probability distributions,

Next exploit constant shape property of Bi

Page 175: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Big Picture

Start with visualizing probability distributions,

Next exploit constant shape property of Binom’l

Page 176: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Big Picture

Start with visualizing probability distributions,

Next exploit constant shape property of Binom’l

Centerpoint feels p

Page 177: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Big Picture

Start with visualizing probability distributions,

Next exploit constant shape property of Binom’l

Centerpoint feels p Spread feels n

Page 178: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Big Picture

Start with visualizing probability distributions,

Next exploit constant shape property of Binom’l

Centerpoint feels p Spread feels n

Page 179: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Big Picture

Start with visualizing probability distributions,

Next exploit constant shape property of Binom’l

Centerpoint feels p Spread feels n

Now quantify these ideas, to put them to work

Page 180: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Notions of Center

Will later study “notions of spread”

Page 181: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Notions of Center

Textbook: Sections 4.4 and 1.2

Page 182: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Notions of Center

Textbook: Sections 4.4 and 1.2

Recall parallel development:

(a) Probability Distributions

(b) Lists of Numbers

Page 183: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Notions of Center

Textbook: Sections 4.4 and 1.2

Recall parallel development:

(a) Probability Distributions

(b) Lists of Numbers

Study 1st, since easier

Page 184: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Notions of Center

(b) Lists of Numbers

“Average” or “Mean”

Page 185: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Notions of Center

(b) Lists of Numbers

“Average” or “Mean” of x1, x2, …, xn

Mean = = xn

xn

ii

1

Page 186: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Notions of Center

(b) Lists of Numbers

“Average” or “Mean” of x1, x2, …, xn

Mean = =

common

notation

xn

xn

ii

1

Page 187: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Notions of Center

(b) Lists of Numbers

“Average” or “Mean” of x1, x2, …, xn

Mean = =

(as before) Greek sigma for sum

means “sum over I = 1,…,n”

xn

xn

ii

1

Page 188: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Notions of Center

HW:

C16: for the data of 1.57, find the mean using

the Excel function AVERAGE (10.03)

Page 189: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Notions of Center

Generalization of Mean:

“Weighted Average”

Page 190: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Notions of Center

Generalization of Mean:

“Weighted Average”

Idea: allow non-equal weights on s:ix

Page 191: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Notions of Center

Generalization of Mean:

“Weighted Average”

Idea: allow non-equal weights on s:ix

n

iiixw

1

Page 192: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Notions of Center

Generalization of Mean:

“Weighted Average”

Idea: allow non-equal weights on s:

Where ,

ix

n

iiixw

1

0iw 1i iw

Page 193: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Notions of Center

Generalization of Mean:

“Weighted Average”

E.g.: ordinary mean has each niw1

Page 194: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Notions of Center

Generalization of Mean:

“Weighted Average”

E.g.: ordinary mean has each

(constant weights)

niw1

Page 195: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Notions of Center

Generalization of Mean:

“Weighted Average”

Intuition: Corresponds to finding balance

point of weights on number line

Page 196: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Notions of Center

Generalization of Mean:

“Weighted Average”

Intuition: Corresponds to finding balance

point of weights on number line

1x 2x 3x

Page 197: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Notions of Center

Generalization of Mean:

“Weighted Average”

Intuition: Corresponds to finding balance

point of weights on number line

1x 2x 3x

Page 198: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Notions of Center

Generalization of Mean:

“Weighted Average”

Intuition: Corresponds to finding balance

point of weights on number line

1x 2x 3x

Page 199: Last Time Hypothesis Testing –1-sided vs. 2-sided Paradox Big Picture Goals –Hypothesis Testing –Margin of Error –Sample Size Calculations Visualization.

Notions of Center

HW: C17: Calculate (and think about as

“balance point”) weighted average of 1, 2, 3,

10 for the weights:

a. ¼, ¼, ¼, 1/4, (ordinary avg.) (4)

b. 0.1, 0.1, 0.1, 0.7 (more on 10) (7.6)

c. 0.3, 0.3, 0.3, 0.1 (less on 10) (2.8)

d. 1/3, 1/3, 1/3, 0 (none on 10) (2)

e. 0, 1, 0, 0 (all on 2) (2)