cumchi(x,df [,upper:T or lower:F]), x and df REAL, elements of df > 0 cumchi(x,df,lam [,upper:T or lower:F]), same x, df, lam REAL with 0 <= lam[i] < 1419.56542578676 |

cumchi(Val,df) computes P(x <= Val) where x is a chi-square random variable with df degrees of freedom. When Val is a vector, matrix or array, the probabilities are computed for each element. When Val and df are both not scalars, they must be the same size and shape which will also be the size and shape of the result. The elements of df must be positive (fractional degrees of freedom are allowed). cumchi(Val, df, upper:T) and cumchi(Val, df, lower:F) do the same except the upper tail probability P(x >= Val) is computed. It is mathematically the same as 1 - cumchi(Val, df), although a more accurate value may be computed. Example: Cmd> 1 - cumchi(sum((obs-e)^2/e), nrows(obs) - 1) # P value Cmd> cumchi(sum((obs-e)^2/e), nrows(obs) - 1, upper:T) # same cumchi(Val,df,lam) computes P(x <= Val) where x is a non-central chi-square random variable with df degrees of freedom and non-centrality parameter lam. Both cumchi(Val,df,lam,upper:T) and cumchi(Val,df,lam, lower:F) compute P(X >= Val). All non-scalar arguments must be the same size and shape which will also be the size and shape of the result. The elements of Val must be non-negative and less than 1419.56542578676. Power of 5% Chi-squared test of test of H_0: p[1] = p0[1], ..., p[k] = p0[k] when p[j] = p1[j], j = 1,...,k based on a multinomial sample of size n: Cmd> cumchi(invchi(.05,k-1,upper:T),k-1,n*sum((p1-p0)^2/p0),upper:T) See also cumgamma(), invchi(), invgamma().

Gary Oehlert 2003-01-15