Statistics/Chi-squared distribution: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 36:
 
: <math display="block"> F(x;\,k) = x^{(k/2)} \, \Gamma(k/2) \, e^{-x} \sum_{m=0}^\infty\frac{x^m}{\Gamma(\frac{k}{2}+m+1)}. </math>
 
;Task:
<br />
* Calculate and show the values of the χ2(x; k) for k = 1 through 5 inclusive and x integer from 0 and through 10 inclusive.
<br />
* Show the cumulative probability function for the χ2 distribution for k = 3.
<br />
* Calculate and show the p values of statistical samples which result in a χ2(k = 3) value of 1, 2, 4, 8, 16, and 32. (Statistical <em>p values</em> can be calculated for the purpose of this task as approximately 1 - P(x), with P(x) the cumulative probability function at x for χ2.)
<br />
:: The following is a chart for 4 airports:
<br />
{| class="wikitable" style="margin:auto"
|+ Flight Delays
|-
! Airport !! On Time !! Delayed !! Totals
|-
| Dallas/Fort Worth || 77 || 23 || 100
|-
| Honolulu || 88 || 12 || 100
|-
| LaGuardia || 79 || 21 || 100
|-
| Orlando || 81 || 19 || 100
|-
| All Totals || 325 || 75 || 400
|-
| Expected per 100 || 81.25 || 18.75 || 100
|}
<br >
:: χ2 on a 2D table is calculated as the sum of the squares of the differences from expected divided by the expected numbers for each entry on the table. The k for the chi-squared distribution is to be calculated as df, the degrees of freedom for the table, which is a 2D parameter, (count of airports - 1) * (count of measures per airport - 1), which here is (4 - 1 )(2 - 1) = 3.
<br />
* Calculate the Chi-squared statistic for the above table and find its p value using your function for the cumulative probability for χ2 with k = 3 from the previous task.
<br /><br />
; Stretch task:
 
* Show how you could make a plot of the curves for the probability distribution function χ2(x; k) for k = 0, 1, 2, and 3.
 
<br /><br /><br />
4,108

edits