fet

package module
v0.0.0-...-53168ae Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 1, 2023 License: MIT Imports: 3 Imported by: 7

README

golang-fisher-exact

Fisher's exact test for 2x2 contingency tables, in Golang (Go).

Ported from the C/C++ at https://github.com/gatoravi/fisher-exact

MIT licensed.

Documentation

Overview

Package fet implements Fisher's Exact Test for 2x2 contigency tables.

It was ported from the C/C++ at https://github.com/gatoravi/fisher-exact

Index

Constants

View Source
const KF_GAMMA_EPS = 1e-14
View Source
const KF_TINY = 1e-290

Variables

This section is empty.

Functions

func ChiSquareStat

func ChiSquareStat(n11 int, n12 int, n21 int, n22 int, yates bool) float64

ChiSquareStat computes the chi-squared test statistic, for a 2x2 contingency table; with optional yates correction. See ChiSquareTest for a p-value.

func ChiSquareTest

func ChiSquareTest(n11 int, n12 int, n21 int, n22 int, yates bool) (stat, pval float64)

ChiSquareTest computes the chi-squared test statistic, for a 2x2 contingency table; with optional yates correction, and then returns the p-value for that test.

func FisherExactTest

func FisherExactTest(n11 int, n12 int, n21 int, n22 int) (probOfCurrentTable, leftp, rightp, twop float64)

FisherExactTest computes Fisher's Exact Test for

contigency tables. Nomenclature:

  n11  n12  | n1_
  n21  n22  | n2_
 -----------+----
  n_1  n_2  | n

Returned values:

probOfCurrentTable = probability of the current table
leftp = the left sided alternative's p-value  (h0: odds-ratio is less than 1)
rightp = the right sided alternative's p-value (h0: odds-ratio is greater than 1)
twop = the two-sided p-value for the h0: odds-ratio is different from 1

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL