Posts Tagged ‘chisquared’
Taught: Can you generate Binomial data?
Background
This is an way of developing the use of the chi-squared distribution, which can also be used to test whether your students can remember what the Binomial distribution looks like!
Start by challenging everyone in the class to generate some data which they feel could be modelled by a Binomial(5,p) distribution, for some value of p. Calculate the value of chi-squared for the frequencies entered (which involves reviewing how to estimate the mean, and what the formula for Binomial is), and then compare that with the critical value needed for the data to be a ‘good fit’ (to, say, a 5% level).
Interactive Binomial Fitness Calculator
I thought I would set myself the challenge of converting this activity into a form which could be directly placed on a Webpage, like this one. After a few days messing around (and a morning wondering why Wordpress didn’t like my Javascript), I can present the following:
Can you generate data which can be modelled well by a binomial distribution?
Try entering frequencies below for data which can be modelled well by Binomial(5, p), for some p. After entering the numbers, click 'Calculate', and the computer will assess how well your data fits a Binomial by performing a chi-squared test.
| Successes | Frequency |
|---|---|
| 0 | |
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 |
(Source: testbinomialmodel.html.)
Note that the condition it is using for goodness of fit is the 5% critical value for chi-squared with four degrees of freedom (6 - 1 because we know the total frequency - 1 because we’re estimating the probability). Note also that it does not combine cells.
Uses
Beyond an initial check of how good students are at modelling a Binomial distribution, this interactive tool can also be used as a tool to explore the Binomial and chi-squared, by systematically altering values and seeing what happens. We can also do something similar, but fix a particular value for the probability of success — this makes it easier to improve by ‘trial and error’ toward a fixed destination, and would also allow us to discuss whether a fit can be too close.
Tags: chisquared, javascript, Lessons Taught, statistics