TEST FOR GOODNESS OF FIT

TEST FOR GOODNESS OF FIT

A goodness fit of Chi-square compares the observed frequencies with the expected or predicted frequencies.  It tests how well the observed data supports the assumption about the population.

CASE ANALYSIS-1


 PROBLEM

The manager of a retail store has to take the decision regarding the quantity of the different types of chocolate bars to be stocked to satisfy the customers demand. The manager claims that the demand for four types of chocolate; Cadbury, Munch, Kit-Kat, Five Star is almost the same in a month period. To test the validity of the claim; a random sample of 50 customers was selected and it produced the following data.

Table-1: Sample Data

The hypotheses for the analysis are:

Null hypothesis-H0: The demand for each chocolate is the same

Alternative Hypothesis- H1: The demand varies for each chocolate type

Input Data

The data are entered into coded variable (Codes: 1 = Cadbury, 2 = Munch, 3 = Kit-Kat, 4 = Five Star). So, there are 11 times 1; 22 times 2; 9 times 3; 8 times 4 in the data sheet as shown below.

Table-2: Input Data

Performing the Analysis with SPSS

For SPSS Version 11, click on Analyze ⇒ Non parametric tests ⇒ Chi-Square.  This will bring up the SPSS screen dialogue box as shown below-square.

After clicking Chi-Square, this will bring up the following SPSS dialogue box.

Select the variable and move it to the Test variable list box and click OK.

SPSS Output

The SPSS outputs of the analysis are depicted in table-2 and table-3.

Chi-Square Test

Frequencies

Table-3: Pref

Table-4: Test Statistics

0 cells (.0%) have expected frequencies less than 5. The minimum expected cell frequency is 12.5.

From the output Chi-Square = 10.000

DECISION

Reject the null hypothesis if p-value ≤ 0.05

INTERPRETATION

The p-value is 0.019 and it is less than 0.05 (5% level of significance). Therefore we reject the null hypothesis and conclude that the average demand varies for each category of chocolate.


CASE ANALYSIS-2


 PROBLEM

A large hotel schedules the shift duties of the staffs assuming that the dwellers check-out the hotel at a constant rate through the week period. Because of staff shortages, the hotel administration wants to observe whether the number of check-outs varies in a week period or not. The check-out data records were collected for a week period as shown below.

Table-1: Sample Data

The hypotheses for the analysis are:

Null hypothesis-H0: Check-out rate is uniformly distributed throughout the week.

Alternative Hypothesis- H1: Check-out rate is not uniform in a week period.

Coded variable

The codes used for the week days are (Codes: 1 = Monday, 2 = Tuesday, 3 = Wednesday, 4 = Thursday, 5 = Friday, 6 = Saturday, 7 = Sunday). The following data sheet is used as input data.

Table-2: Input Data

SPSS Output

Chi-Square Test

Frequencies

Table-3: Checkout

Table-2: Test Statistics

a 0 cells (.0%) have expected frequencies less than 5. The minimum expected cell frequency is 8.0.

 INTERPRETATION

The p-value is 0.062 and it is more than 0.05 (5% level of significance). Therefore we accept the null hypothesis and conclude that the check-out rate is uniformly distributed in a week period.

SPSS Commands

  1. Click on ANALYZE at the SPSS menu bar (in older versions of SPSS, click on STATISTICS instead of ANALYZE).
  2. Click on NONPARAMETRIC followed by CHI-SQUARE
  3. Select the variables and move them to TEST VARIABLE LIST BOX
  4. Now click on the button OK.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: