![]() |
|
| apop_data* apop_anova | ( | char * | table, | |
| char * | data, | |||
| char * | grouping1, | |||
| char * | grouping2 | |||
| ) |
This function produces a traditional one- or two-way ANOVA table. It works from data in an SQL table, using queries of the form select data from table group by grouping1, grouping2.
| table | The table to be queried. | |
| data | The name of the column holding the data | |
| grouping1 | The name of the first column by which to group data | |
| grouping2 | If this is NULL, then the function will return a one-way ANOVA. Otherwise, the name of the second column by which to group data in a two-way ANOVA. |
| double apop_test | ( | double | statistic, | |
| char * | distribution, | |||
| double | p1, | |||
| double | p2, | |||
| char | tail | |||
| ) |
This is a convenience function to do the lookup of a given statistic along a given distribution. You give me a statistic, its (hypothesized) distribution, and whether to use the upper tail, lower tail, or both. I will return the odds of a Type I error given the model---in statistician jargon, the
-value. [Type I error: odds of rejecting the null hypothesis when it is true.]
For example,
apop_test(1.3);
will return the density of the standard Normal distribution that is more than 1.3 from zero. If this function returns a small value, we can be confident that the statistic is significant. Or,
apop_test(1.3, "t", 10, tail='u');
will give the appropriate odds for an upper-tailed test using the
-distribution with 10 degrees of freedom (e.g., a
-test of the null hypothesis that the statistic is less than or equal to zero).
Several more distributions are supported; see below.
| statistic | The scalar value to be tested. | |
| distribution | The name of the distribution; see below. | |
| p1 | The first parameter for the distribution; see below. | |
| p2 | The second parameter for the distribution; see below. | |
| tail | 'u' = upper tail; 'l' = lower tail; anything else = two-tailed. (default = two-tailed) |
-value).Here is a list of distributions you can use, and their parameters.
"normal" or "gaussian"
"lognormal"
"uniform"
"t"
"chi squared", "chi", "chisq":
-value for typical cases)"f"