Statistics/Chi-squared distribution: Difference between revisions

m (move example down)
Line 137:
 
println("\nFor the airport data, diff total is $dtotal, χ2 is ", χ2(dtotal, 3), ", p value ", cdf_χ2(dtotal, 3))
 
using Plots
x = 0.0:0.01:10
y = [map(p -> χ2(p, k), x) for k in 0:3]
 
plot(x, y, yaxis=[-0.1, 0.5], labels=[0 1 2 3])
</syntaxhighlight>{{out}}
<pre>
Line 164 ⟶ 170:
For the airport data, diff total is 4.512820512820512, χ2 is 0.08875392598443503, p value 0.7888504263193064
</pre>
[[File:Chi-squaredplot.png|thumb|Graph of Chi-Squared for k values 0 through 3]]
 
 
 
=={{header|Phix}}==
4,108

edits