x2prob - chi squared probability

Syntax: float x2prob(float x, float degrees)
Description: Returns the probability that a chi squared distributed variable with degrees of freedom will have a value less than or equal to x
Code sample:
#Create 10000 normally distributed random numbers
x = normrnd(10000);       
#Create a histogram of the values
h = histogram(x,-3:3);       
#Calculate the expected number of datavalues in each group
e = diff(normprob(-3:3)//1)*1000000;       
#Calculate the q value
q = sum((h-e)**2/e);       
#Test q value with x2prob
p = 1 - x2prob(q,7);       
#p<0.05 indicates that the data is not
#normally distributed random data
echo(p);     
See also: normprob, normrnd, tprob

xpmsemiv - See Kriging Interpolation

 

 

 

 

 

 

 

 

 

 

.