Lumach+R


 * __Lumachine __**


 * __Group members: __**

- Martha Foiani

- Karina Kaur

- Nisha Patel

- Sophia Walsh

- Madeleine Berry Bush Bush Bush Grass Grass Grass
 * __Results__**

1

Black Green Orange Red Yellow

2 8 7 2 1

2

Black Green Orange Red Yellow

1 10 4 2 3

3

Black Green Red Yellow

1 9 9 1

4

Black Green Red Yellow

1 9 9 1

5

Black Green Orange Red Yellow

4 1 6 6 3

6

Black Green Orange Red Yellow

5 8 2 2 3

Chi-squared test is a statistical test used to compare observed data we would expect to obtain according to a specific hypothesis. The chi-squared test is always testing the null hypothesis. Our null hypothesis is that there is no difference in underlying frequencies in jelly babies in the two habitats. The p value is not the chance that the null hypothesis is true or false it is the probability that we would get a result this different or bigger if the null hypothesis is true. A low p value doesn’t prove that the difference is not due to sampling error or that the null hypothesis is false.
 * **__Population__** || **__Black__** || **__Green__** || **__Orange__** || **__Red__** || **__Yellow__** || **__Total (rows)__** ||
 * **__1__** || 2 || 8 || 7 || 2 || 1 || 20 ||
 * **__2__** || 1 || 10 || 4 || 2 || 3 || 20 ||
 * **__3__** || 1 || 9 || 0 || 9 || 1 || 20 ||
 * **__4__** || 1 || 9 || 0 || 9 || 1 || 20 ||
 * **__5__** || 4 || 1 || 6 || 6 || 3 || 20 ||
 * **__6__** || 5 || 8 || 2 || 2 || 3 || 20 ||
 * **__Total (columns)__** || 14 || 45 || 20 || 30 || 12 || 120 ||

We will combine the population of black and yellow jelly babies as the expected value is less than 3 in both cases.
 * __Expected values__**
 * __Black:__** 14/6=2.3
 * __Green:__** 45/6=7.5
 * __Orange__**: 20/6=3.3
 * __Red:__** 30/6=5
 * __Yellow:__** 12/6=2
 * **__Population__** || **__Black and Yellow__** || **__Green__** || **__Orange__** || **__Red__** || **__Total (rows)__** ||
 * **__1__** || 3 || 8 || 7 || 2 || 20 ||
 * **__2__** || 4 || 10 || 4 || 2 || 20 ||
 * **__3__** || 2 || 9 || 0 || 9 || 20 ||
 * **__4__** || 2 || 9 || 0 || 9 || 20 ||
 * **__5__** || 7 || 1 || 6 || 6 || 20 ||
 * **__6__** || 8 || 8 || 2 || 2 || 20 ||
 * **__Total (columns)__** || 26 || 45 || 20 || 30 || 120 ||


 * __Expected values__**
 * __Black and Yellow:__** 26/6=4.3
 * __Green:__** 45/6=7.5
 * __Orange__**: 20/6=3.3
 * __Red:__** 30/6=5
 * __ Independent replication – Bush habitat __**
 * **__Population__** || **__Black and Yellow__** || **__Green__** || **__Orange__** || **__Red__** || **__Total (rows)__** ||
 * **__1__** || 3 || 8 || 7 || 2 || 20 ||
 * **__2__** || 4 || 10 || 4 || 2 || 20 ||
 * **__3__** || 2 || 9 || 0 || 9 || 20 ||
 * **__Total (columns)__** || **__9__** || 27 || 11 || 11 || 60 ||


 * __Expected values__**
 * __Black and Yellow:__** 9/3=3
 * __Green:__** 27/3=9
 * __Orange__**: 11/3=3.7
 * __Red:__** 11/3=3.7
 * __Black and Yellow__**
 * **__Population__** || **__O-E__** || **__(O-E)²__** || **__(O-E)²/E__** ||
 * **__1__** || 0 || 0 || 0 ||
 * **__2__** || 1 || 1 || 0.33 ||
 * **__3__** || -1 || 1 || 0.33 ||


 * __Green__**
 * **__Population__** || **__O-E__** || **__(O-E)²__** || **__(O-E)²/E__** ||
 * **__1__** || -1 || 1 || 0.11 ||
 * **__2__** || 1 || 1 || 0.11 ||
 * **__3__** || 0 || 0 || 0 ||


 * __Orange__**
 * **__Population__** || **__O-E__** || **__(O-E)²__** || **__(O-E)²/E__** ||
 * **__1__** || 3.3 || 10.89 || 2.94 ||
 * **__2__** || 0.3 || 0.09 || 0.024 ||
 * **__3__** || -3.7 || 13.69 || 3.7 ||


 * __Red__**
 * **__Population__** || **__O-E__** || **__(O-E)²__** || **__(O-E)²/E__** ||
 * **__1__** || -1.7 || 2.89 || 0.78 ||
 * **__2__** || -1.7 || 2.89 || 0.78 ||
 * **__3__** || 5.3 || 28.09 || 7.6 ||

Chi-squared value = 16.7 P value = 0.01 Critical value = 16.81 The chi-squared value is less than the critical value. When the chi-squared value is less than or equal to 16.81 we can expect it to occur 99% of the time. To reject the null hypothesis the chi-squared value (16.7) has to be greater than the critical value (16.81) in this case it is not so we fail to reject the null hypothesis. This means that the probability that there is no difference in underlying frequencies in jelly babies in bushes is 99%.


 * __ Independent replication – Grass habitat __**
 * **__Population__** || **__Black and Yellow__** || **__Green__** || **__Orange__** || **__Red__** || **__Total (rows)__** ||
 * **__1__** || 2 || 9 || 0 || 9 || 20 ||
 * **__2__** || 7 || 1 || 6 || 6 || 20 ||
 * **__3__** || 8 || 8 || 2 || 2 || 20 ||
 * **__Total (columns)__** || **__17__** || 18 || 8 || 17 || 60 ||


 * __Expected values__**
 * __Black and Yellow:__** 17/3=5.67
 * __Green:__** 18/3=6
 * __Orange__**: 8/3=2.67
 * __Red:__** 17/3=5.67
 * __Black and Yellow__**
 * **__Population__** || **__O-E__** || **__(O-E)²__** || **__(O-E)²/E__** ||
 * **__1__** || -3.67 || 13.46 || 2.38 ||
 * **__2__** || 1.33 || 1.76 || 0.31 ||
 * **__3__** || 2.33 || 5.42 || 0.96 ||


 * __Green__**
 * **__Population__** || **__O-E__** || **__(O-E)²__** || **__(O-E)²/E__** ||
 * **__1__** || 3 || 9 || 1.5 ||
 * **__2__** || -5 || 25 || 4.17 ||
 * **__3__** || 2 || 4 || 0.67 ||


 * __Orange__**
 * **__Population__** || **__O-E__** || **__(O-E)²__** || **__(O-E)²/E__** ||
 * **__1__** || -2.67 || 7.12 || 2.67 ||
 * **__2__** || 3.33 || 11.08 || 4.15 ||
 * **__3__** || -0.67 || 0.44 || 0.17 ||


 * __Red__**
 * **__Population__** || **__O-E__** || **__(O-E)²__** || **__(O-E)²/E__** ||
 * **__1__** || 3.33 || 11.08 || 1.96 ||
 * **__2__** || 0.33 || 0.10 || 0.019 ||
 * **__3__** || -3.67 || 13.46 || 2.38 ||

Chi-squared value = 21.3 P value = 0.002 Critical value = 20.25 The chi-squared value (21.3) is larger than the critical value (20.25). So in this case we can reject the null hypothesis. P= 0.002 so we can be 98% sure there is a significant difference in the underlying frequencies in jelly babies in the grass habitat.