- Thread starter 02020954
- Start date

The Numerical Algorithms Group makes a popular statistical library for c/c++ called NAG C Library. You can also search for anova in c if you are only interested in the anova table.

I did write a program to do one way anova . The big deal in here is that I could not find how to calculate the p value from the f value. :shakehead

You guys have any ideas about how to calculate p value from f value in anova function? such as some formulars ???

I found in Mathlab the functions call

Pvalue = 1 - fcdf (Fvalue, degree_freedom(1), degree_freedom(2));

however, it is too hard to write a function fcdf because inside this function has a nested other functions that is impossible to implement in C++.

any helps ?

Thank you

The following page shows how to generate various probability distributions from the uniform random number generator available with any software, including VB or C:

http://members.aol.com/johnp71/course/course04.html

Follow the chain from Uniform --> Normal --> Chi-Square --> F

I used some of this logic to help me generate skewed (i.e., chi-square) distributions and distributions with kurtosis (i.e, t-distribution) in my thesis.

Instead of going from uniform --> normal the way it is described above (kinda slow), it may go faster if you use the Box-Muller method described here:

http://www.taygeta.com/random/gaussian.html

http://davidmlane.com/hyperstat/F_table.html

and/or

http://members.aol.com/johnp71/pdfs.html