SlideShare a Scribd company logo
1 of 22
Chi square
Dr David Playfoot
d.r.playfoot@swansea.ac.uk
Conor vs Khabib
This fight is taking place on 6th October.
Who should you bet on to win? What do the experts think?
Conor vs Khabib
• Let’s imagine that there are 550 experts who offer a prediction
publicly
• Let’s say that 286 of the experts think Connor will win
• Seems like a majority opinion, right? Connor is a clear favourite
• Well…
Conor vs Khabib
• When an expert is asked they will have to say Connor will win OR Khabib
will win
(draws are technically possible in MMA, but very rarely happen).
• There are essentially 2 options, and nobody knows which is right.
• Given 2 options about anything, we might expect that 50% of people
choose option a, and 50% choose option b.
• Therefore we would expect 275 votes for Connor if people decided by
tossing a coin!
Conor vs Khabib
• The question is whether significantly more experts think Connor will
win.
• To decide, we have to compare the number of people voting Connor
to the number we would expect by chance alone.
• This is what chi square does.
Chi square
• Test of nominal data
• Count people who fall into different categories
• People can only fit into one category
Connor supporters Khabib supporters
286 264
Chi square
• WARNING – there’s a formula on the next page. Don’t run away, I’ll
explain everything and you’ll find it’s not that scary
Chi square
 



E
EO
2
2

Chi square
 



E
EO
2
2

This is the way to write “chi square.” It is the Greek lowercase letter chi (not an X) and a superscript 2.
Looks fancy, but there’s nothing scary about that.
Chi square
 



E
EO
2
2

This is the Greek uppercase letter sigma. It means “the sum of” –
basically add up all the numbers you get from doing the next bit to the right
 



E
EO
2
2

Chi square
The O stands for “observed.” All that is is the number you got from your actual data collection
 



E
EO
2
2

Chi square
Both times you see an E it stands for “expected.” It’s just the number you would get by chance
Chi square
• In real words chi square tells you to
1. Take a number from your data collection (e.g. 286 Connor supporters)
2. Subtract the number you’d expect to pick that option by chance (in this case half of
550 = 275, so 286 – 275 = 11)
3. Square the result of step 2 (11 x 11 = 121)
4. Divide the result of 3 by the number expected by chance (121/275 = 0.44)
5. Repeat steps 1-4 for another number from your data collection until you run out of
numbers. (264 Khabib supporters – 275 = -11 then -11 x -11 = 121 then 121/275 =
0.44)
6. Add up the results of all the step 4s you had to do. That’s your chi square value. (0.44
+ 0.44 = 0.88)
Chi square
• In the old days, you’d then look up the critical value of chi square for your
degrees of freedom
• For a single row chi-square like ours, the degrees of freedom are k – 1, where k is the number of
available categories.
• see Glossary section on Blackboard for an explanation of what degrees of freedom are if you can’t
remember
• If the value you calculated (0.88 in our case) was bigger than the critical
value (in this case 3.84) then you have observed a number that is
significantly different from what would be expected by chance
• We haven’t. Don’t use the experts to influence your bet. Plus I made it up
anyway
RxC Chi square
• Most of the time our design is more complicated than the Connor vs
Khabib example.
• By the way, that version is known as the “goodness of fit chi square” because we are
seeing how well an observed pattern fits the expected distribution.
• It is more likely that you have 2 variables changing at once.
• As long as your data follow the rules, you can still use chi square
• The rules are the same as before – see slide 6
RxC Chi square
• Say someone wanted to determine whether fans of different music
were more or less likely to get hurt at a show
• Count the number of fans leaving the venue bloodied
• Three different acts
• Concerts lasted the same amount of time
Welsh National Opera Slayer Ed Sheeran Total
Ended up bleeding
Did not bleed at all
Total
RxC Chi square
• Say someone wanted to determine whether fans of different music
were more or less likely to get hurt at a show
• Count the number of fans leaving the venue bloodied
• Three different acts
• Concerts lasted the same amount of time
Welsh National Opera Slayer Ed Sheeran Total
Ended up bleeding
Did not bleed at all
Total
Act seen
RxC Chi square
• Say someone wanted to determine whether fans of different music
were more or less likely to get hurt at a show
• Count the number of fans leaving the venue bloodied
• Three different acts
• Concerts lasted the same amount of time
Welsh National Opera Slayer Ed Sheeran Total
Ended up bleeding
Did not bleed at all
Total
Injury?
RxC Chi square
• Say someone wanted to determine whether fans of different music
were more or less likely to get hurt at a show
• Count the number of fans leaving the venue bloodied
• Three different acts
• Concerts lasted the same amount of time
Welsh National Opera Slayer Ed Sheeran Total
Ended up bleeding 5 18 12
Did not bleed at all 95 82 88
Total
People
observed for
each category
RxC Chi square
• Say someone wanted to determine whether fans of different music
were more or less likely to get hurt at a show
• Count the number of fans leaving the venue bloodied
• Three different acts
• Concerts lasted the same amount of time
Welsh National Opera Slayer Ed Sheeran Total
Ended up bleeding 5 18 12 35
Did not bleed at all 95 82 88 265
Total 100 100 100
RxC Chi square
• This is an example of a multivariate or row (R) x column (C) chi square
• The principle is the same, and so is the maths
• The only difference is in the calculation of the expected frequency for each cell.
• There are just more numbers
• If there is no relationship between the act onstage and the number of
people injured then we should observe the same proportion of
bleeders in each of our columns – chi square tells you whether this is
what happened.
THE LARGER YOUR χ2 VALUE, THE BIGGER THE
DIFFERENCE BETWEEN WHAT WAS OBSERVED AND
WHAT WAS EXPECTED
Remember

More Related Content

Recently uploaded

MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MysoreMuleSoftMeetup
 
Orientation Canvas Course Presentation.pdf
Orientation Canvas Course Presentation.pdfOrientation Canvas Course Presentation.pdf
Orientation Canvas Course Presentation.pdf
Elizabeth Walsh
 
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonQUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
httgc7rh9c
 

Recently uploaded (20)

dusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learningdusjagr & nano talk on open tools for agriculture research and learning
dusjagr & nano talk on open tools for agriculture research and learning
 
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Orientation Canvas Course Presentation.pdf
Orientation Canvas Course Presentation.pdfOrientation Canvas Course Presentation.pdf
Orientation Canvas Course Presentation.pdf
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17
 
PANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxPANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptx
 
Play hard learn harder: The Serious Business of Play
Play hard learn harder:  The Serious Business of PlayPlay hard learn harder:  The Serious Business of Play
Play hard learn harder: The Serious Business of Play
 
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Diuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdf
Diuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdfDiuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdf
Diuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdf
 
Michaelis Menten Equation and Estimation Of Vmax and Tmax.pptx
Michaelis Menten Equation and Estimation Of Vmax and Tmax.pptxMichaelis Menten Equation and Estimation Of Vmax and Tmax.pptx
Michaelis Menten Equation and Estimation Of Vmax and Tmax.pptx
 
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonQUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
 

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Conor, Khabib and chi square

  • 1. Chi square Dr David Playfoot d.r.playfoot@swansea.ac.uk
  • 2. Conor vs Khabib This fight is taking place on 6th October. Who should you bet on to win? What do the experts think?
  • 3. Conor vs Khabib • Let’s imagine that there are 550 experts who offer a prediction publicly • Let’s say that 286 of the experts think Connor will win • Seems like a majority opinion, right? Connor is a clear favourite • Well…
  • 4. Conor vs Khabib • When an expert is asked they will have to say Connor will win OR Khabib will win (draws are technically possible in MMA, but very rarely happen). • There are essentially 2 options, and nobody knows which is right. • Given 2 options about anything, we might expect that 50% of people choose option a, and 50% choose option b. • Therefore we would expect 275 votes for Connor if people decided by tossing a coin!
  • 5. Conor vs Khabib • The question is whether significantly more experts think Connor will win. • To decide, we have to compare the number of people voting Connor to the number we would expect by chance alone. • This is what chi square does.
  • 6. Chi square • Test of nominal data • Count people who fall into different categories • People can only fit into one category Connor supporters Khabib supporters 286 264
  • 7. Chi square • WARNING – there’s a formula on the next page. Don’t run away, I’ll explain everything and you’ll find it’s not that scary
  • 9. Chi square      E EO 2 2  This is the way to write “chi square.” It is the Greek lowercase letter chi (not an X) and a superscript 2. Looks fancy, but there’s nothing scary about that.
  • 10. Chi square      E EO 2 2  This is the Greek uppercase letter sigma. It means “the sum of” – basically add up all the numbers you get from doing the next bit to the right
  • 11.      E EO 2 2  Chi square The O stands for “observed.” All that is is the number you got from your actual data collection
  • 12.      E EO 2 2  Chi square Both times you see an E it stands for “expected.” It’s just the number you would get by chance
  • 13. Chi square • In real words chi square tells you to 1. Take a number from your data collection (e.g. 286 Connor supporters) 2. Subtract the number you’d expect to pick that option by chance (in this case half of 550 = 275, so 286 – 275 = 11) 3. Square the result of step 2 (11 x 11 = 121) 4. Divide the result of 3 by the number expected by chance (121/275 = 0.44) 5. Repeat steps 1-4 for another number from your data collection until you run out of numbers. (264 Khabib supporters – 275 = -11 then -11 x -11 = 121 then 121/275 = 0.44) 6. Add up the results of all the step 4s you had to do. That’s your chi square value. (0.44 + 0.44 = 0.88)
  • 14. Chi square • In the old days, you’d then look up the critical value of chi square for your degrees of freedom • For a single row chi-square like ours, the degrees of freedom are k – 1, where k is the number of available categories. • see Glossary section on Blackboard for an explanation of what degrees of freedom are if you can’t remember • If the value you calculated (0.88 in our case) was bigger than the critical value (in this case 3.84) then you have observed a number that is significantly different from what would be expected by chance • We haven’t. Don’t use the experts to influence your bet. Plus I made it up anyway
  • 15. RxC Chi square • Most of the time our design is more complicated than the Connor vs Khabib example. • By the way, that version is known as the “goodness of fit chi square” because we are seeing how well an observed pattern fits the expected distribution. • It is more likely that you have 2 variables changing at once. • As long as your data follow the rules, you can still use chi square • The rules are the same as before – see slide 6
  • 16. RxC Chi square • Say someone wanted to determine whether fans of different music were more or less likely to get hurt at a show • Count the number of fans leaving the venue bloodied • Three different acts • Concerts lasted the same amount of time Welsh National Opera Slayer Ed Sheeran Total Ended up bleeding Did not bleed at all Total
  • 17. RxC Chi square • Say someone wanted to determine whether fans of different music were more or less likely to get hurt at a show • Count the number of fans leaving the venue bloodied • Three different acts • Concerts lasted the same amount of time Welsh National Opera Slayer Ed Sheeran Total Ended up bleeding Did not bleed at all Total Act seen
  • 18. RxC Chi square • Say someone wanted to determine whether fans of different music were more or less likely to get hurt at a show • Count the number of fans leaving the venue bloodied • Three different acts • Concerts lasted the same amount of time Welsh National Opera Slayer Ed Sheeran Total Ended up bleeding Did not bleed at all Total Injury?
  • 19. RxC Chi square • Say someone wanted to determine whether fans of different music were more or less likely to get hurt at a show • Count the number of fans leaving the venue bloodied • Three different acts • Concerts lasted the same amount of time Welsh National Opera Slayer Ed Sheeran Total Ended up bleeding 5 18 12 Did not bleed at all 95 82 88 Total People observed for each category
  • 20. RxC Chi square • Say someone wanted to determine whether fans of different music were more or less likely to get hurt at a show • Count the number of fans leaving the venue bloodied • Three different acts • Concerts lasted the same amount of time Welsh National Opera Slayer Ed Sheeran Total Ended up bleeding 5 18 12 35 Did not bleed at all 95 82 88 265 Total 100 100 100
  • 21. RxC Chi square • This is an example of a multivariate or row (R) x column (C) chi square • The principle is the same, and so is the maths • The only difference is in the calculation of the expected frequency for each cell. • There are just more numbers • If there is no relationship between the act onstage and the number of people injured then we should observe the same proportion of bleeders in each of our columns – chi square tells you whether this is what happened.
  • 22. THE LARGER YOUR χ2 VALUE, THE BIGGER THE DIFFERENCE BETWEEN WHAT WAS OBSERVED AND WHAT WAS EXPECTED Remember