SlideShare a Scribd company logo
1
OBJECTIVES
• Recognise a suitable distribution to apply chi
  square test to
• Conduct the goodness-of-fit test of hpothesis
• Conduct the test of independence
• Conduct a test of homgeneity



                                                   2
Chi square distribution
• Positively skewed
• Test done on right tail only
• Therefore all chi square tests are positive with
  one critical value only
• Basic steps of hypothesis test are the same, only
  the test statistic and distribution have changed


                                                  3
• Techniques used to analyse data up to now was
  measured on quantitative scale.
• Results of tests can often be classified into categories
  where there is no natural order:
   – Categorical variable
   – Categories
   – Categorical data
• Categorical data can be analysed with Chi-squared
  tests:
   – Simple random sample
   – Sample size reasonable large
                                                             4
Example:
• Survey of job satisfaction
• Employed persons classified as satisfied, neutral,
  dissatisfied
CATEGORICAL VARIABLE – is employee satisfaction

CATEGORIES – satisfied, neutral, dissatisfied

CATEGORICAL DATA – no. of employees satisfied,
neutral or dissatisfied (also referred to as frequency of
category)
                                                        5
Examples
1. A persons income can be categorised as high,
   medium or low. Define the categorical variable,
   the categories and the categorical data
2. We want to investigate different types of
   industries, e.g. information technology,
   financial and transformation. Define the
   categorical variable, the categories and the
   categorical data

                                                 6
Example answers
1. Categorical variable is income. Categories are
   high, medium and low. Categorical data are the
   no. of people who have high, medium or low
   income
2. Categorical variable is type of industry,
   categories are information technology, financial
   and transformation. Categorical data are the no
   of industries that are information tech, financial
   or transformation
                                                    7
• Chi-squared goodness-of-fit test
  – This test describes a single population of categorical data.
  – The multinomial experiment studied is an extension of the
    binomial experiment.
     • There are n independent trials.
     • The outcome of each trial can be classified into one of
       k categories.
     • The probability pi of cell i remains constant for each
       trial. Moreover, p1 + p2 + … +pk = 1.
  – Experiment records the observed trails for each category.
  – Denoted by f1, f2, …, fk and f1 + f2 + … + fk = n
                                                            8
EXAMPLE
In a box of smarties you will find 6 different colours:
brown, red,yellow,blue,orange and green. A
random sample of smarties (6918 in total) was
taken and the frequesncy of each colour was
counted. The distribution of colours is given below
     Colour   Brown   Red    Yellow   Blue   Orange Green
        f     1611    1172   1308     904    921    1002


Determine whether the smarties survey fits the
description of a multinomial experiment

                                                            9
EXAMPLE
Answer:
See example 10.1, p350, textbook




                                   10
To use the Χ2-tests
•   The goodness-of-fit test                      all expected
                                               frequencies must
     – Used to determine if the observed counts ofbe at least 5
                                                   the
      categories agree with the probabilities specified for
      each category.
    – Observed frequencies (f ) compared with the expected
      frequencies (e).

    Testing H0: Proportions agree with specified probabilities

     Alternative             Decision rule:
                                                 Test statistic
     hypothesis              Reject H0 if …
                                                     ( fi  ei )2
    H1: H0 is not true   Χ2 > Χ2k – 1;1 – α   2  
                                                          ei 11
• Example
      – A household detergent is marketed in three sizes:
          • 1 000 ml, 750 ml and 250 ml
      – The distributers belief that the market share of the different sizes is
        as follow:
          • 1 000 ml = 40%
          • 750 ml = 45%
          • 250 ml = 15%.
      – To study the effect of the economic climate on the sales of the
        products, 200 customers were ask to state which size they will
        prefer.
 •   Survey results:
      – 82 customers preferred the 1 000 ml
      – 102 customers preferred the 750 ml
      – 16 customers preferred the 250 ml
                                                                                  12
• Solution
  –   The population investigated is the size preferences.
  –   The data are in categories.
  –   This is a multinomial experiment (three categories).
  –   The question of interest: Are p1, p2, and p3 different
      from the expected 40%, 45% and 15%?




                                                               13
• The hypotheses are:                                                    Expected
                                                                            frequencies are
         – H0: p1 = 0,40, p2 = 0,45, p3 = 0,15                                   all ≥ 5

         – H1: At least one pi is not equal to its specified value.
  Are the observed and the expected frequencies the same?
                                                                             Expected
       Expected frequencies                   Observed values               frequencies
                                             16
  15%
                                                                              ei = npi
                        40%   1000ml                        82   1000ml   40% of 200 = 80
                              750ml                              750ml
                              250ml                              250ml
                                                                          45% of 200 = 90
                                       102
45%                                                                       15% of 200 = 30
                                                                                   14
• The hypotheses are:
         – H0: p1 = 0,40, p2 = 0,45, p3 = 0,15
         – H1: At least one pi is not equal to its specified value.
  Are the observed and the expected frequencies the same?
                                                                              Expected
                                                                             frequencies
       Expected frequencies                    Observed values

   30
  15%
                                              16                               ei = npi
                                                                           40% of 200 = 80
                          80
                        40%    1000ml                        82   1000ml
                               750ml                              750ml    45% of 200 = 90
                               250ml                              250ml
                                                                           15% of 200 = 30
                                        102
90
45%                                                                                  15
• The hypotheses are:
  – H0: p1 = 0,40, p2 = 0,45, p3 = 0,15
  – H1: At least one pi is not equal to its specified value.
           ( fi  ei ) 2
    2                                                                 α = 0,05
                ei
                                                             0       5,9917
                                                                     Χ2k – 1;1 – α
          (82  80) (102  90) (16  30)
                     2                   2              2
                                 
              80          90            30           Accept H0 Reject H0

         8,18     Conclusion: At 5% significance level there is
  – Reject H0.           sufficient evidence to reject the null hypothesis.
                         At least one of the probabilities pi is different.
                         Thus, at least two market shares have changed.     16
Two friends were playing a board game in which a die played a
big role. One of the players believed that the die was not fair.
60 tosses of the die produced the results below. Test at 5%
significance level whether the die was fair.


Number of dots     1       2       3       4        5       6
Number of tosses   7       6       7       18       15      7




                                                            17
ei = npi
                 = 60(1/6)
                 = 10
               Expected values for the six categories are: 10   10   10   10   10   10
               H0: p1 = … = p6 = 1/6
               H1: At least one pi ≠ 1/6
                = 0,05
                              f  e
                                       2
                =
                2
                                 e
                      7 10 + … +
                                  2
                                           (7 10) 2
                    =
                             10               10
                  = 13,2                                            Accept H0 Reject H0
                 2
                k 1;1 
                  2
                                      
               =  5; 0,95
               = 11,07

               Therefore, reject H0. The probabilities of the dots are not equal and the die was not
     
               fair.
                                                                                             18
• Chi-squared test for independence
  – Cross classify two categories using a contingency table.
  – Rows representing one category and columns
    representing the other category.
  – Each value in cell indicates the frequency in the cross
    classification.
  – Table can be any number of rows and columns:
     • r×c number of cells


                                                          19
CONCEPT QUESTIONS
• Questions 1 – 3 , p356




                            20
• Chi-squared test for independence
   – H0: the two variables are independent – no relationship.
   – H1: the two variables are dependent – is a relationship.

 For a 2×2 contingency table:
               B
 A       B1        B2    Total
 A1      f11       f12    r1
                                           Observed
 A2      f21       f22    r2              frequencies
Total    c1        c2     n

                                                          21
• Chi-squared test for independence
      – Contingency tables describe the relationship between two
        categorical variables.
      – H0: the two variables are independent – no relationship.
      – H1: the two variables are dependent – is a relationship.
For a 2×2 contingency table:                 For each observed
                 B
                                          frequency an expected
                                             frequency must be
 A         B1        B2    Total                 calculated
 A1        f11       f12    r1
 A2        f21       f22    r2        row total × column total
                                   e=
Total      c1        c2     n                     n        22
• Chi-squared test for independence
        – Contingency tables describe the relationship between two
          categorical variables.
        – H0: the two variables are independent – no relationship.
        – H1: the two variables are dependent – is a relationship.
 For a 2×2 contingency tabel:
                 B
                                        row total × column total
 A         B1        B2    Total   e=
                                                        n
 A1        f11       f12    r1
 A2        f21       f22    r2
                                   e11  (r1  c1 ) / n ; e12  (r1  c2 ) / n
Total      c1        c2     n      e21  (r2  c1 ) / n ; e22  (r2 23 2 ) / n
                                                                     c
• Chi-squared test for independence
   – H0: the two variables are independent – no relationship.
   – H1: the two variables are dependent – is a relationship.


            Testing H0: Variables are independent

  Alternative           Decision rule:
                                                       Test statistic
  hypothesis            Reject H0 if …

                                                       ( f  e)         2
                                                   
H1: Variables are
                    Χ2 > Χ2(r – 1)(c – 1);1 – α    2
   dependent
                                                           e
                                                                        24
• Example
 – A household detergent is marketed in three sizes:
    • 1 000 ml, 750 ml and 250 ml
 – The market for potential buyers is divided into three
   age groups:
    • < 30 years old
    • 30–50 years old
    • > 50 years old
 – Market researcher believe that there is a relationship
   between the age of a buyer and the size of the
   packaging.                                               25
• Solution
  – The data is summarised in a 3×3 contingency table.
  – H0: Size and age are independent.
                                           Observed
  – H1: Size and age are dependent.       frequencies

                    Age groups
  Size       < 30     30–50        > 50        Total
1 000 ml     27          41         14          82
 750 ml      39          18         45         102
 250 ml       8           2          6          16
 Total       74          61         65         200     26
• Solution
  – Calculate the expected frequency
  – (Row total×column total)/n          Expected frequency:
                                       (74×82)/200 = 30,34

                     Age groups
  Size       < 30      30–50      > 50          Total
1 000 ml   27 30,34 41 25,01 14 26,65            82
 750 ml    39 37,74 18 31,11 45 33,15            102
 250 ml    8    5,92 2     4,88 6    5,20         16
  Total       74         61        65            200
                                                        27
Χ2(r – 1)(c – 1);1 – α =
                                                              Χ2(3-1)(3-1);0.95 = 9.49
• The hypotheses are:
  – H0: Size and age are independent
                                                                         α = 0,05
  – H1: Size and age are dependent
                                                          0          9,49
         ( f  e)  2
    
    2

             e
                                                           Accept H0      Reject H0
       (27  30,34) 2 (41  25, 01) 2           (6  5, 20) 2
                                     ..... 
           30,34          25, 01                   5, 20
      28,95
  – Reject H0.         Conclusion: At 5% significance level there is
                       sufficient evidence to reject the null hypothesis.
                       There is a relationship between the size of detergent
                       that people prefer and their age.                  28
A recent survey of marketing managers in four different industries provided
 the data in the table below, which gives managers attitudes to market
 research and its value in marketing decision making:-
                                                INDUSTRY TYPE
Perceived value        Consumer            Industrial          Retail &        Finance &
of M Research          businesses        organisations        wholesale        insurance

Little value      9                 22                   13               9
Moderate value    29                41                   6                17
Great value       26                28                   6                27
TOTAL             64                91                   25               53


 Test at 1% level of significance whether manager’s perception of the value
 of the market research is dependent on the type of industry in which a
 marketing manager is employed.                                         29
Industry type

     Perceived value of market                 Consumer     Industrial  Retail and Finance Total
                                                                                     and
     research                                  businesses organisations wholesale insurance

     Little value                               9 (14,56)   22 (20,7)      13 (5,69)    9 (12,06)    53
     Moderate value                            29 (25,55)   41 (36,32)     6 (9,98)     17 (21,15)   93
     Great value                                26 (23,9)   28 (33,98)     6 (9,33)     27 (19,79)   87
     Total                                            64       91              25          53        233
               H0: Manager’s perception is independent of industry type.
               H1: Manager’s perception is dependent of industry type.
                = 0,01
                            f  e
                                    2
                =
                2
                            e
                      9 14,56 + … + 27 19,79
                                2                 2
                    =
                         14,56             19,79
                  = 20,895
                2
               r 1c 1;1 
                                                                                    Accept H0 Reject H0
           =  2                      
                 6; 0,99
               = 16,81
             Therefore, reject H0. Manager’s perception is dependent on the industry type.         30
     
Questions 4 – 6, p361, textbook




                                  31
• Chi-squared Test of Homogeneity
  – Test if two or more populations are homogeneous (similar)
    with regard to a certain characteristic.
  – H0: The proportion of elements with certain characteristic in
    two or more different populations are the same.
  – H1: The proportion of elements with certain characteristic in
    two or more different populations are not the same.
  – The rest of the test is the same as the test for
    independence.

                                                            32
An immigration attorney was investigating which industries to
target for obtaining new clients who might have problems with
change in the immigration laws. The lawyer selected five
industries and twenty workers were randomly selected in each
industry and their visa statuses were verified.
          VISA STATUS               INDUSTRY
                          A   B       C        D      E
       Illegal resident   8   10      5        10     1
       Legal resident     4   2       6        4      9
       SA citizen         8   8       9        6      10

Test at a 1% level of significance whether the 5 industries are
homogeneous with respect to the visa status of their workers
                                                           33
Industry
          Visa status                                                                           Total
                                           A       B        C            D            E
 Illegal resident 8 (6,8) 10 (6,8) 5 (6,8) 10 (6,8) 1 (6,8)                                      34
 Legal resident 4 (5)                             2 (5)    6 (5)      4 (5)         9 (5)        25
 SA citizen                              8 (8,2) 8 (8,2) 9 (8,2) 6 (8,2) 10 (8,2) 41
 Total                                    20       20       20          20           20         100
               H0: Five industries are homogeneous with respect to the visa status of their
               workers.
               H1: Five industries are heterogeneous with respect to the visa status of their
               workers.
                = 0,01
                            f  e
                                    2
               2 =        e
                    8  6,8 + … + 10  8,2
                              2               2
                  =
                        6,8             8,2
                = 15,32
                2
               r 1c 1;1 
           =  2                  
                 8; 0,99
               = 20,09                                                                                  34
             Therefore, do not reject H0. The five industries are homogeneous with respect to
             the visa status of their workers.
CLASSWORK/HOMEWORK
1. Activity 1,2,3,4 – p168 – 174, Module
   Manual
2. Revision exercise 1, 2, 3 4 – p174 -176,
   Module Manual
3. Self Review Test – 1 – 4, p 368, textbook
4. Supplementary Exercises 1 – 11, p370,
   textbook


                                               35

More Related Content

PDF
Statistics lecture 9 (chapter 8)
PPTX
Hypothesis testing examples on z test
PPTX
Sampling Distributions
PDF
Probability Distributions
PPTX
Week1 GM533 Slides
PPTX
Probability Distribution
PPTX
Probability distributions
PPT
MTH120_Chapter9
Statistics lecture 9 (chapter 8)
Hypothesis testing examples on z test
Sampling Distributions
Probability Distributions
Week1 GM533 Slides
Probability Distribution
Probability distributions
MTH120_Chapter9

What's hot (17)

PPTX
Goodness of fit test
PDF
C2 st lecture 11 the t-test handout
PPTX
Chap09 hypothesis testing
PPTX
law of large number and central limit theorem
PPT
Les5e ppt 06
PPT
Les5e ppt 05
PPT
Les5e ppt 04
PPTX
6. point and interval estimation
PPTX
Probability Distributions for Continuous Variables
PDF
Statistical inference: Probability and Distribution
PPTX
Probability distributions & expected values
PPT
Msb12e ppt ch06
PPTX
Hypothesis Testing-Z-Test
PPTX
Probability Distribution & Modelling
PPTX
Introduction To Data Science Using R
DOC
Week7 Quiz Help 2009[1]
PPT
Tbs910 sampling hypothesis regression
Goodness of fit test
C2 st lecture 11 the t-test handout
Chap09 hypothesis testing
law of large number and central limit theorem
Les5e ppt 06
Les5e ppt 05
Les5e ppt 04
6. point and interval estimation
Probability Distributions for Continuous Variables
Statistical inference: Probability and Distribution
Probability distributions & expected values
Msb12e ppt ch06
Hypothesis Testing-Z-Test
Probability Distribution & Modelling
Introduction To Data Science Using R
Week7 Quiz Help 2009[1]
Tbs910 sampling hypothesis regression
Ad

Viewers also liked (8)

PPTX
Chi square test
PPTX
Chi square test
PPT
Chi square2012
PPTX
Chi sequare
PPT
Presentation week 8
PPT
Chi square[1]
PPTX
Chi square test final
PPT
Chi Square Worked Example
Chi square test
Chi square test
Chi square2012
Chi sequare
Presentation week 8
Chi square[1]
Chi square test final
Chi Square Worked Example
Ad

Similar to Statistics lecture 10(ch10) (20)

PPT
Data analysis
PDF
Session 14
PPTX
30043005-Hypothesis-Test-Full chapter.pptx
PDF
P value in proportion
PPT
Tests of significance
PPTX
Hypothesis testing1
PPTX
Intro to tests of significance qualitative
PPTX
Hypothesis and t-tests
PDF
Advanced Engineering Mathematics (Statistical Techniques - II)
PPTX
standar error of proporton hypthesis testing standard error of diff t test.pptx
PPTX
Hypothesis testing - college hypothesis testing
PDF
8. testing of hypothesis for variable &amp; attribute data
PPTX
Statr session 17 and 18
PPTX
Statr session 17 and 18 (ASTR)
PPTX
Topic 7 stat inference
PPT
Malimu statistical significance testing.
PPTX
Confidence intervals, hypothesis testing and statistical tests of significanc...
PPTX
Sample size
PPTX
Midterm 3 review
PPTX
Test of-significance : Z test , Chi square test
Data analysis
Session 14
30043005-Hypothesis-Test-Full chapter.pptx
P value in proportion
Tests of significance
Hypothesis testing1
Intro to tests of significance qualitative
Hypothesis and t-tests
Advanced Engineering Mathematics (Statistical Techniques - II)
standar error of proporton hypthesis testing standard error of diff t test.pptx
Hypothesis testing - college hypothesis testing
8. testing of hypothesis for variable &amp; attribute data
Statr session 17 and 18
Statr session 17 and 18 (ASTR)
Topic 7 stat inference
Malimu statistical significance testing.
Confidence intervals, hypothesis testing and statistical tests of significanc...
Sample size
Midterm 3 review
Test of-significance : Z test , Chi square test

More from jillmitchell8778 (20)

PDF
Revision workshop 17 january 2013
PDF
Statistics lecture 13 (chapter 13)
PDF
Statistics lecture 12 (chapter 12)
PDF
Statistics lecture 11 (chapter 11)
PDF
Statistics lecture 8 (chapter 7)
PPTX
Qr code lecture
PDF
Poisson lecture
PDF
Statistics lecture 7 (ch6)
PDF
Normal lecture
PDF
Binomial lecture
PDF
Statistics lecture 6 (ch5)
PDF
Project admin lu3
PPTX
Priject admin lu 2
PPTX
Project admin lu 1
PPTX
Lu5 how to assess a business opportunity
PPTX
Lu4 – life cycle stages of a business
PPT
Statistics lecture 5 (ch4)
PPTX
Learning unit 2
Revision workshop 17 january 2013
Statistics lecture 13 (chapter 13)
Statistics lecture 12 (chapter 12)
Statistics lecture 11 (chapter 11)
Statistics lecture 8 (chapter 7)
Qr code lecture
Poisson lecture
Statistics lecture 7 (ch6)
Normal lecture
Binomial lecture
Statistics lecture 6 (ch5)
Project admin lu3
Priject admin lu 2
Project admin lu 1
Lu5 how to assess a business opportunity
Lu4 – life cycle stages of a business
Statistics lecture 5 (ch4)
Learning unit 2

Recently uploaded (20)

PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PDF
Anesthesia in Laparoscopic Surgery in India
PDF
Complications of Minimal Access Surgery at WLH
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
102 student loan defaulters named and shamed – Is someone you know on the list?
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
Sports Quiz easy sports quiz sports quiz
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
PPTX
Cell Structure & Organelles in detailed.
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
Insiders guide to clinical Medicine.pdf
PDF
O7-L3 Supply Chain Operations - ICLT Program
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Anesthesia in Laparoscopic Surgery in India
Complications of Minimal Access Surgery at WLH
Microbial diseases, their pathogenesis and prophylaxis
Abdominal Access Techniques with Prof. Dr. R K Mishra
102 student loan defaulters named and shamed – Is someone you know on the list?
PPH.pptx obstetrics and gynecology in nursing
Sports Quiz easy sports quiz sports quiz
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Saundersa Comprehensive Review for the NCLEX-RN Examination.pdf
Cell Structure & Organelles in detailed.
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
VCE English Exam - Section C Student Revision Booklet
Insiders guide to clinical Medicine.pdf
O7-L3 Supply Chain Operations - ICLT Program
Module 4: Burden of Disease Tutorial Slides S2 2025
Final Presentation General Medicine 03-08-2024.pptx
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
BÀI TẬP BỔ TRỢ 4 KỸ NĂNG TIẾNG ANH 9 GLOBAL SUCCESS - CẢ NĂM - BÁM SÁT FORM Đ...
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf

Statistics lecture 10(ch10)

  • 1. 1
  • 2. OBJECTIVES • Recognise a suitable distribution to apply chi square test to • Conduct the goodness-of-fit test of hpothesis • Conduct the test of independence • Conduct a test of homgeneity 2
  • 3. Chi square distribution • Positively skewed • Test done on right tail only • Therefore all chi square tests are positive with one critical value only • Basic steps of hypothesis test are the same, only the test statistic and distribution have changed 3
  • 4. • Techniques used to analyse data up to now was measured on quantitative scale. • Results of tests can often be classified into categories where there is no natural order: – Categorical variable – Categories – Categorical data • Categorical data can be analysed with Chi-squared tests: – Simple random sample – Sample size reasonable large 4
  • 5. Example: • Survey of job satisfaction • Employed persons classified as satisfied, neutral, dissatisfied CATEGORICAL VARIABLE – is employee satisfaction CATEGORIES – satisfied, neutral, dissatisfied CATEGORICAL DATA – no. of employees satisfied, neutral or dissatisfied (also referred to as frequency of category) 5
  • 6. Examples 1. A persons income can be categorised as high, medium or low. Define the categorical variable, the categories and the categorical data 2. We want to investigate different types of industries, e.g. information technology, financial and transformation. Define the categorical variable, the categories and the categorical data 6
  • 7. Example answers 1. Categorical variable is income. Categories are high, medium and low. Categorical data are the no. of people who have high, medium or low income 2. Categorical variable is type of industry, categories are information technology, financial and transformation. Categorical data are the no of industries that are information tech, financial or transformation 7
  • 8. • Chi-squared goodness-of-fit test – This test describes a single population of categorical data. – The multinomial experiment studied is an extension of the binomial experiment. • There are n independent trials. • The outcome of each trial can be classified into one of k categories. • The probability pi of cell i remains constant for each trial. Moreover, p1 + p2 + … +pk = 1. – Experiment records the observed trails for each category. – Denoted by f1, f2, …, fk and f1 + f2 + … + fk = n 8
  • 9. EXAMPLE In a box of smarties you will find 6 different colours: brown, red,yellow,blue,orange and green. A random sample of smarties (6918 in total) was taken and the frequesncy of each colour was counted. The distribution of colours is given below Colour Brown Red Yellow Blue Orange Green f 1611 1172 1308 904 921 1002 Determine whether the smarties survey fits the description of a multinomial experiment 9
  • 11. To use the Χ2-tests • The goodness-of-fit test all expected frequencies must – Used to determine if the observed counts ofbe at least 5 the categories agree with the probabilities specified for each category. – Observed frequencies (f ) compared with the expected frequencies (e). Testing H0: Proportions agree with specified probabilities Alternative Decision rule: Test statistic hypothesis Reject H0 if … ( fi  ei )2 H1: H0 is not true Χ2 > Χ2k – 1;1 – α 2   ei 11
  • 12. • Example – A household detergent is marketed in three sizes: • 1 000 ml, 750 ml and 250 ml – The distributers belief that the market share of the different sizes is as follow: • 1 000 ml = 40% • 750 ml = 45% • 250 ml = 15%. – To study the effect of the economic climate on the sales of the products, 200 customers were ask to state which size they will prefer. • Survey results: – 82 customers preferred the 1 000 ml – 102 customers preferred the 750 ml – 16 customers preferred the 250 ml 12
  • 13. • Solution – The population investigated is the size preferences. – The data are in categories. – This is a multinomial experiment (three categories). – The question of interest: Are p1, p2, and p3 different from the expected 40%, 45% and 15%? 13
  • 14. • The hypotheses are: Expected frequencies are – H0: p1 = 0,40, p2 = 0,45, p3 = 0,15 all ≥ 5 – H1: At least one pi is not equal to its specified value. Are the observed and the expected frequencies the same? Expected Expected frequencies Observed values frequencies 16 15% ei = npi 40% 1000ml 82 1000ml 40% of 200 = 80 750ml 750ml 250ml 250ml 45% of 200 = 90 102 45% 15% of 200 = 30 14
  • 15. • The hypotheses are: – H0: p1 = 0,40, p2 = 0,45, p3 = 0,15 – H1: At least one pi is not equal to its specified value. Are the observed and the expected frequencies the same? Expected frequencies Expected frequencies Observed values 30 15% 16 ei = npi 40% of 200 = 80 80 40% 1000ml 82 1000ml 750ml 750ml 45% of 200 = 90 250ml 250ml 15% of 200 = 30 102 90 45% 15
  • 16. • The hypotheses are: – H0: p1 = 0,40, p2 = 0,45, p3 = 0,15 – H1: At least one pi is not equal to its specified value. ( fi  ei ) 2 2   α = 0,05 ei 0 5,9917 Χ2k – 1;1 – α (82  80) (102  90) (16  30) 2 2 2    80 90 30 Accept H0 Reject H0  8,18 Conclusion: At 5% significance level there is – Reject H0. sufficient evidence to reject the null hypothesis. At least one of the probabilities pi is different. Thus, at least two market shares have changed. 16
  • 17. Two friends were playing a board game in which a die played a big role. One of the players believed that the die was not fair. 60 tosses of the die produced the results below. Test at 5% significance level whether the die was fair. Number of dots 1 2 3 4 5 6 Number of tosses 7 6 7 18 15 7 17
  • 18. ei = npi = 60(1/6) = 10 Expected values for the six categories are: 10 10 10 10 10 10 H0: p1 = … = p6 = 1/6 H1: At least one pi ≠ 1/6  = 0,05  f  e 2  = 2  e 7 10 + … + 2 (7 10) 2 = 10 10  = 13,2 Accept H0 Reject H0 2  k 1;1   2  =  5; 0,95 = 11,07  Therefore, reject H0. The probabilities of the dots are not equal and the die was not  fair. 18
  • 19. • Chi-squared test for independence – Cross classify two categories using a contingency table. – Rows representing one category and columns representing the other category. – Each value in cell indicates the frequency in the cross classification. – Table can be any number of rows and columns: • r×c number of cells 19
  • 20. CONCEPT QUESTIONS • Questions 1 – 3 , p356 20
  • 21. • Chi-squared test for independence – H0: the two variables are independent – no relationship. – H1: the two variables are dependent – is a relationship. For a 2×2 contingency table: B A B1 B2 Total A1 f11 f12 r1 Observed A2 f21 f22 r2 frequencies Total c1 c2 n 21
  • 22. • Chi-squared test for independence – Contingency tables describe the relationship between two categorical variables. – H0: the two variables are independent – no relationship. – H1: the two variables are dependent – is a relationship. For a 2×2 contingency table: For each observed B frequency an expected frequency must be A B1 B2 Total calculated A1 f11 f12 r1 A2 f21 f22 r2 row total × column total e= Total c1 c2 n n 22
  • 23. • Chi-squared test for independence – Contingency tables describe the relationship between two categorical variables. – H0: the two variables are independent – no relationship. – H1: the two variables are dependent – is a relationship. For a 2×2 contingency tabel: B row total × column total A B1 B2 Total e= n A1 f11 f12 r1 A2 f21 f22 r2 e11  (r1  c1 ) / n ; e12  (r1  c2 ) / n Total c1 c2 n e21  (r2  c1 ) / n ; e22  (r2 23 2 ) / n c
  • 24. • Chi-squared test for independence – H0: the two variables are independent – no relationship. – H1: the two variables are dependent – is a relationship. Testing H0: Variables are independent Alternative Decision rule: Test statistic hypothesis Reject H0 if … ( f  e) 2   H1: Variables are Χ2 > Χ2(r – 1)(c – 1);1 – α 2 dependent e 24
  • 25. • Example – A household detergent is marketed in three sizes: • 1 000 ml, 750 ml and 250 ml – The market for potential buyers is divided into three age groups: • < 30 years old • 30–50 years old • > 50 years old – Market researcher believe that there is a relationship between the age of a buyer and the size of the packaging. 25
  • 26. • Solution – The data is summarised in a 3×3 contingency table. – H0: Size and age are independent. Observed – H1: Size and age are dependent. frequencies Age groups Size < 30 30–50 > 50 Total 1 000 ml 27 41 14 82 750 ml 39 18 45 102 250 ml 8 2 6 16 Total 74 61 65 200 26
  • 27. • Solution – Calculate the expected frequency – (Row total×column total)/n Expected frequency: (74×82)/200 = 30,34 Age groups Size < 30 30–50 > 50 Total 1 000 ml 27 30,34 41 25,01 14 26,65 82 750 ml 39 37,74 18 31,11 45 33,15 102 250 ml 8 5,92 2 4,88 6 5,20 16 Total 74 61 65 200 27
  • 28. Χ2(r – 1)(c – 1);1 – α = Χ2(3-1)(3-1);0.95 = 9.49 • The hypotheses are: – H0: Size and age are independent α = 0,05 – H1: Size and age are dependent 0 9,49 ( f  e) 2   2 e Accept H0 Reject H0 (27  30,34) 2 (41  25, 01) 2 (6  5, 20) 2    .....  30,34 25, 01 5, 20  28,95 – Reject H0. Conclusion: At 5% significance level there is sufficient evidence to reject the null hypothesis. There is a relationship between the size of detergent that people prefer and their age. 28
  • 29. A recent survey of marketing managers in four different industries provided the data in the table below, which gives managers attitudes to market research and its value in marketing decision making:- INDUSTRY TYPE Perceived value Consumer Industrial Retail & Finance & of M Research businesses organisations wholesale insurance Little value 9 22 13 9 Moderate value 29 41 6 17 Great value 26 28 6 27 TOTAL 64 91 25 53 Test at 1% level of significance whether manager’s perception of the value of the market research is dependent on the type of industry in which a marketing manager is employed. 29
  • 30. Industry type Perceived value of market Consumer Industrial Retail and Finance Total and research businesses organisations wholesale insurance Little value 9 (14,56) 22 (20,7) 13 (5,69) 9 (12,06) 53 Moderate value 29 (25,55) 41 (36,32) 6 (9,98) 17 (21,15) 93 Great value 26 (23,9) 28 (33,98) 6 (9,33) 27 (19,79) 87 Total 64 91 25 53 233 H0: Manager’s perception is independent of industry type. H1: Manager’s perception is dependent of industry type.  = 0,01  f  e 2  = 2  e 9 14,56 + … + 27 19,79 2 2 = 14,56 19,79  = 20,895 2 r 1c 1;1  Accept H0 Reject H0  =  2  6; 0,99 = 16,81  Therefore, reject H0. Manager’s perception is dependent on the industry type. 30 
  • 31. Questions 4 – 6, p361, textbook 31
  • 32. • Chi-squared Test of Homogeneity – Test if two or more populations are homogeneous (similar) with regard to a certain characteristic. – H0: The proportion of elements with certain characteristic in two or more different populations are the same. – H1: The proportion of elements with certain characteristic in two or more different populations are not the same. – The rest of the test is the same as the test for independence. 32
  • 33. An immigration attorney was investigating which industries to target for obtaining new clients who might have problems with change in the immigration laws. The lawyer selected five industries and twenty workers were randomly selected in each industry and their visa statuses were verified. VISA STATUS INDUSTRY A B C D E Illegal resident 8 10 5 10 1 Legal resident 4 2 6 4 9 SA citizen 8 8 9 6 10 Test at a 1% level of significance whether the 5 industries are homogeneous with respect to the visa status of their workers 33
  • 34. Industry Visa status Total A B C D E Illegal resident 8 (6,8) 10 (6,8) 5 (6,8) 10 (6,8) 1 (6,8) 34 Legal resident 4 (5) 2 (5) 6 (5) 4 (5) 9 (5) 25 SA citizen 8 (8,2) 8 (8,2) 9 (8,2) 6 (8,2) 10 (8,2) 41 Total 20 20 20 20 20 100 H0: Five industries are homogeneous with respect to the visa status of their workers. H1: Five industries are heterogeneous with respect to the visa status of their workers.  = 0,01  f  e 2 2 =  e 8  6,8 + … + 10  8,2 2 2 = 6,8 8,2  = 15,32 2 r 1c 1;1   =  2  8; 0,99 = 20,09 34  Therefore, do not reject H0. The five industries are homogeneous with respect to  the visa status of their workers.
  • 35. CLASSWORK/HOMEWORK 1. Activity 1,2,3,4 – p168 – 174, Module Manual 2. Revision exercise 1, 2, 3 4 – p174 -176, Module Manual 3. Self Review Test – 1 – 4, p 368, textbook 4. Supplementary Exercises 1 – 11, p370, textbook 35