Lecture 21 Comparing Counts - Chi-square test

Similar documents
Where Was Mars At Your Birth?

Your Zodiac Signs Say A Lot About Your Fears And This Is Damn True!

YouGov Survey Results

Name: Partner(s): Day/Time: Version: plan

Lucky days for aries -gambling

Zodiac Signs That Would Make The Perfect Couples

1. (25) Suppose that a bag of Skittles contains 20 Reds, 25 Yellows, 22 Purples, 15 Oranges and 18 Greens.

Sagittarius man pisces woman bed

Lecture 41 Sections Mon, Apr 7, 2008

Your First Name Your Name

For this exercise, I will use astrosage.com.

Aquarius lottery horoscope

Medieval Astrology. I do much damage by my might, On sea and land, by day and night. My exaltation s in the Scales, But in the Ram my power fails.

Lucky days for libra in march 2017

Old Moore's Horoscope And Daily Astral Diary Aquarius By Dr. Francis Moore READ ONLINE

Basic Statistics for Astrologers

Sun Mon Tue Wed Thu Fri Sat

The goodness-of-fit test Having discussed how to make comparisons between two proportions, we now consider comparisons of multiple proportions.

Lecture 41 Sections Wed, Nov 12, 2008

Sun Signs By Linda Goodman READ ONLINE

Sun Mon Tue Wed Thu Fri Sat

Free scorpio love horoscopes today and tomorrow

Interpret Astrology The House Combinations. By Michael Erlewine

Taurus lucky gambling days

NAKSHATRAS BY GURMEET SINGH

Glyph Correspondences for the OOTK

Let us measure for the exact amount of flooring needed. ocal Flooring P Redwood Drive, Cotati CSL # w w.cit y-carpet s.

ASTROLOGY CALENDAR 2018

ARIES HOROSCOPE 2016 By Lisa Lazuli

Sun Mon Tue Wed Thu Fri Sat

Virgo lucky days to gamble 2016

Module 10: Analysis of Categorical Data Statistics (OA3102)

LESSON 5 THE UPACHAYA HOUSES

Chapter 26: Comparing Counts (Chi Square)


The Perennial Ecliptic Calendar

- SPACE/TIME GUIDE ARIES. Matariki rises late evening & is visible until early morning. Matariki rises. at dusk & is visible until late LEO

Astrological Calendar. for Central Time

Check light diagnostic. engine

Old Moore's Horoscope Daily Astral Diary 2016 Gemini 2016 By Francis Moore READ ONLINE

Aquarius woman libra man fighting

2018 Mini Workbook. This is 's workbook 2018 AT A GLANCE: URANUS: STARTS IN ARIES ENTERS TAURUS MAY 15TH BACK IN ARIES NOV 6TH

drinking straw, protractor, string, and rock. observer on Earth. Sun across the sky on March 21 as seen by an

Sun Mon Tue Wed Thu Fri Sat

APRIL. Mon. Tue. Wed. Thu. Fri. Sat. Sun. Success is simple. Do what s right, the right way, at the right time. Arnold H. Glasow

Horoscopes daily The Borg System is 100 % Retrievable & Reusable Horoscopes daily

DOZENALS. A project promoting base 12 counting and measuring. Ideas and designs by DSA member (#342) and board member, Timothy F. Travis.

Lecture 2 Motions in the Sky September 10, 2018

Physics Lab #2:! Starry Night Introduction!

THE MAGIC OF WISDOM. Lectures. Perth, Australia Occidental, Rangoon, 19 th of September 1950

Taurus lucky day for gambling

Sun Mon Tue Wed Thu Fri Sat

Technical Definition of the Ecliptic Calendar by Damon Scott Status of the Technical Definitions Idea of Heliocentric and Geocentric

Horoscope Symbols By Robert Hand

Lecture 9. Selected material from: Ch. 12 The analysis of categorical data and goodness of fit tests

Astrology: An In-Depth Look Into The Zodiac Signs: Become Wealthy, Find Your True Love, And Master Your Destiny Using Astrology

Across the Universe. By Gabrielle Sierra

Physics Lab #4: Learning Starry Night, Part 3

Don t be Embarrassed. We don t believe in dumb questions.

How To Survive A Pisces : Real Life Guidance On How To Get On And Be Friends With The Last Sign Of The Zodiac By Mary English READ ONLINE

Lucky colors for capricorn october

MATERIALS TO SUPPORT KINESTHETIC ASTRONOMY LESSONS

What are the lucky colors numbers days for a Gemini? The notion of lucky days,. Is year of the monkey lucky in gambling?.

chapter 10 questions_pictures removed.notebook September 28, 2017 Chapter 10 What We Know About the Universe Has Taken Us Thousands of Years to Learn

Libra lucky days for gambling

If searched for the ebook ASTROLOGY: Zodiac Signs & Horoscope The Complete Book to Astrology And The 12 Zodiac Signs. Using Astrology for

Today. Announcements: How much do we know? Mystics, Astrology, etc.

Winning Spring Break Story The winning spring break story was #4. This was about the girl who could not turn back time. Today Announcements:

Yr1 Lesson 1. The Great Circles of Astrology, the Angles, Precession,

Jupiter from 1927 to 2026

Contents. Introduction 6. Aries At a glance 9 Your year ahead for Month-by-month forecasts 17

The Major Elements Earths Toolbox

Correlations between breast cancer and planetary configurations By Alphee Lavoie, NCGR Level IV. Abstract

But, before you can compare one personʼs chart with anotherʼs, you need to know a bit about basic astrological principles.

Avail Virgo daily money and finance horoscope for 2018 and get an upper hand with all your finances so that you may spend wisely and invest smartly.

Cosmic Rhythms Connection To Farming Activities. Free Subsidy Available to Organic Farmers

Topic 21 Goodness of Fit

DECEMBER JANUARY. Mon. Tue. Wed. Thu. Fri 1. Sat. Sun HIGH ENERGY DAYS DECEMBER S M T W T F S LAST QUARTER

Today. Announcements: How much can we know? Mystics, Astrology, etc.

DOWNLOAD OR READ : THE ASTROLOGY OF YOU AND ME HOW TO UNDERSTAND AND IMPROVE EVERY RELATIONSHIP IN YOUR LIFE PDF EBOOK EPUB MOBI

Astrochart Links: Pennsic 43: coming July 25

To The Astrological Signs Archetypes And Planets

If you are mesmerized by the idea of moon magic and manifesting and want to know more, check out New Moon Astrology by Janet Spiller.

Sun Mon Tue Wed Thu Fri Sat

OCTOBER. Mon. Tue. Wed. Thu. Fri 1. Sat. Sun. Don t smile because it s over, smile because it happened. Dr. Seuss HIGH ENERGY DAYS OCTOBER 2014

CHAPTER 2 - THE HOUSE STRUCTURE

Astrology Class Madison, Wisconsin. 43 North 89 West. September Daylight

Chapter 10. Chapter 10. Multinomial Experiments and. Multinomial Experiments and Contingency Tables. Contingency Tables.

Additional information >>> HERE <<< # Download Free ebook chinese horoscope compatibility dragon and monkey - ebook

L i b r a h o r o s c o p t o d a y l u

DECEMBER JANUARY. Mon 4. Tue. Wed. Thu. Fri. Sat. Sun HIGH ENERGY DAYS JANUARY MOON VOC UNTIL 1:09PM MOON INTO ARIES H. MERCURY SEXTILE MARS

Chi-square (χ 2 ) Tests

Aries personality traits female

Pisces lucky day for gambling

CALCULATING THE NATAL CHART LESSON 4

Chapter 18: Categorical data

There is proof in math

Practice Exam #3. Part 1: The Circumpolar Constellations

Field Activitie< for Chapter 5 The Cycle of the Sun

Constellation Originations and Modern Interpretations --- Andromeda Constellation and Mythology. Presented By: Coral Rea

Transcription:

Lecture 21 Comparing Counts - Chi-square test Thais Paiva STA 111 - Summer 2013 Term II August 5, 2013 1 / 20 Thais Paiva STA 111 - Summer 2013 Term II Lecture 21, 08/05/2013

Lecture Plan 1 Goodness of fit 2 Independence 3 Homogeneity 2 / 20 Thais Paiva STA 111 - Summer 2013 Term II Lecture 21, 08/05/2013

CEOs and the Zodiac Fortune magazine collected the zodiac signs of 256 heads of the 400 largest companies: Sign Count Aries 23 Taurus 20 Gemini 18 Cancer 23 Leo 20 Virgo 19 Libra 18 Scorpio 21 Sagittarius 19 Capricorn 22 Aquarius 24 Pisces 29 3 / 20 Thais Paiva STA 111 - Summer 2013 Term II Lecture 21, 08/05/2013

CEOs and the Zodiac There are more Pisces than anything else Are there enough of them to constitute evidence that CEOs are more likely to be some signs rather than others? If the distribution were uniform, we would expect 256 12 = 21.33 births in each sign How closely to the observed births fit this null model? 4 / 20 Thais Paiva STA 111 - Summer 2013 Term II Lecture 21, 08/05/2013

Goodness of fit We will be testing whether the null model fits the observed data. Since there is no parameter to estimate, CIs do not make sense If we were only interested in Pisces, we could use a one-proportion z-test with H 0 : p = 1 12 H A : p > 1 12 But we are interested in the distribution of births. We need a test that takes all signs into account 5 / 20 Thais Paiva STA 111 - Summer 2013 Term II Lecture 21, 08/05/2013

Goodness of fit Assumptions and conditions: The data are counts for two or more categories Each unit is independent of the other units Sample size: We should expect to see at least 5 in each cell (some authors say at least 1) In the zodiac example, we would need n such that n 12 > 5 6 / 20 Thais Paiva STA 111 - Summer 2013 Term II Lecture 21, 08/05/2013

Goodness of fit Calculations: In each cell, we expect a certain count under the null ( n 12 ) If the null model fits the data, the expected and observed counts should be similar Just like with OLS regression, we will square the differences: p χ 2 (Obs i Exp i ) 2 = Exp i i=1 χ 2 p 1, where p is the number of cells 7 / 20 Thais Paiva STA 111 - Summer 2013 Term II Lecture 21, 08/05/2013

The χ 2 distribution Like the t, the χ 2 is indexed by degrees of freedom Unlike the t, the χ 2 is skewed and always positive density 0.00 0.05 0.10 0.15 density 0.00 0.02 0.04 0.06 0.08 0 5 10 15 20 25 30 x 0 5 10 15 20 25 30 x χ 2 4 χ 2 15 8 / 20 Thais Paiva STA 111 - Summer 2013 Term II Lecture 21, 08/05/2013

The χ 2 test for goodness of fit p χ 2 (Obs i Exp i ) 2 = Exp i i=1 χ 2 p 1 density α 1 α χ α 2 x 9 / 20 Thais Paiva STA 111 - Summer 2013 Term II Lecture 21, 08/05/2013

One-sided or two-sided? If the data does not match the null model, then χ 2 will always be big It works like a one-sided test 10 / 20 Thais Paiva STA 111 - Summer 2013 Term II Lecture 21, 08/05/2013

Back to the zodiac H 0 : p Aries = p Taurus =... = p Pisces H A : not all p i equal Exp i = 256 12 = 21.333 for each i = 1,..., 12 χ 2 = 12 i=1 = 5.094 (Obs i 21.333) 2 21.333 χ 2 11 which gives a p-value > 0.25 From the back of the book (p. 676): P[χ 2 11 > 13.7] = 0.25, so > 5.094] > 0.25 P[χ 2 11 There is virtually no evidence of a non-uniform distribution of zodiac signs among executives 11 / 20 Thais Paiva STA 111 - Summer 2013 Term II Lecture 21, 08/05/2013

Independence A study at the University of Texas Southwestern examined whether the risk of hepatitis C was related to whether people had tattoos and to where they got their tattoos. Hep. C No hep C Total Tattoo, parlor 17 35 52 Tattoo, elsewhere 8 53 61 No tattoo 22 491 513 Total 47 579 626 This type of data is different we have a single group that is categorized according to two variables This is called a contingency table 12 / 20 Thais Paiva STA 111 - Summer 2013 Term II Lecture 21, 08/05/2013

Independence We could convert the counts to proportions, and see whether P(Parlor and hep C) = P(Parlor) P(hep C), for example But even if the variables were independent, the equality would never turn out to hold exactly How close does it have to be? We can use a χ 2 test for independence 13 / 20 Thais Paiva STA 111 - Summer 2013 Term II Lecture 21, 08/05/2013

Independence χ 2 = R,C i=1,j=1 (Obs ij Exp ij ) 2 Exp ij χ 2 (R 1)(C 1) Hep. C No hep C Total Tattoo, parlor 17 3.9 35 48.1 52 Tattoo, elsewhere 8 4.6 53 56.4 61 No tattoo 22 38.5 491 474.5 513 Total 47 579 626 Assuming independence, Exp 11 = 626 52 626 47 626 = 3.9 Number of degrees of freedom is now (R 1)(C 1) R: # of rows and C: # of columns 14 / 20 Thais Paiva STA 111 - Summer 2013 Term II Lecture 21, 08/05/2013

Independence: tattoos and hepatitis H 0 :Tattoo status and hepatitis status are independent H A :Tattoo status and hepatitis status are not independent χ 2 = 3,2 i=1,j=1 = 57.91 (Obs ij Exp ij ) 2 Exp ij χ 2 2 which gives a p-value < 0.001 (from the back of the book) There is strong evidence towards tattoo status and hepatitis C status not being independent 15 / 20 Thais Paiva STA 111 - Summer 2013 Term II Lecture 21, 08/05/2013

Homogeneity Many high schools survey graduating classes to determine their plans. We might wonder whether plans have stayed roughly the same through the decades. 1980 1990 2000 Total College 320 245 288 853 Employment 98 24 17 139 Military 18 19 5 42 Travel 17 2 5 24 Total 453 290 315 1058 16 / 20 Thais Paiva STA 111 - Summer 2013 Term II Lecture 21, 08/05/2013

Homogeneity Assumptions and conditions: The data are counts for two or more categories, with two or more groups to compare Each unit that is counted is independent of the other units Sample size: We should expect to see at least a 5 in each cell In the class plans example, we would need n such that n 4 > 5 for each year 17 / 20 Thais Paiva STA 111 - Summer 2013 Term II Lecture 21, 08/05/2013

Homogeneity χ 2 = R,C i=1,j=1 (Obs ij Exp ij ) 2 Exp ij χ 2 (R 1)(C 1) 1980 1990 2000 Total College 320 365.23 245 233.81 288 253.96 853 Employment 98 59.52 24 38.10 17 41.39 139 Military 18 17.98 19 11.51 5 12.50 42 Travel 17 10.27 2 6.59 5 7.15 24 Total 453 290 315 1058 Assuming independence, Exp 21 = 1058 139 1058 453 1058 = 59.52 Calculation is exactly the same as in the independence test 18 / 20 Thais Paiva STA 111 - Summer 2013 Term II Lecture 21, 08/05/2013

Back to high school H 0 : The post-high school choices have the same distribution in 1980, 1990, and 2000 H A : The post-high school choices in 1980, 1990, and 2000 do not have the same distribution χ 2 = 4,3 i=1,j=1 = 72.77 (Obs ij Exp ij ) 2 Exp ij χ 2 6 which gives a p-value < 0.001 (from the back of the book) There is strong evidence of inhomogeneity 19 / 20 Thais Paiva STA 111 - Summer 2013 Term II Lecture 21, 08/05/2013

Summary 1 Goodness of fit 2 Independence 3 Homogeneity 20 / 20 Thais Paiva STA 111 - Summer 2013 Term II Lecture 21, 08/05/2013