Contingency Table VI

Owning Palette: Hypothesis Testing VIs

Requires: Full Development System

Computes the Pearson 2 test for independence. This function is used to test whether the row and column categorical variables of the contingency table are independent.

Details  

 Add to the block diagram  Find on the palette
Table is the input contingency table of counts or frequencies.
x is the calculated Pearson's 2 test statistic.
probability, or p value, returns the probability of observing a sample statistic as extreme as the test statistic. If this value is less than a desired significance level, you should conclude that there is a relationship between the row and column variables.
error returns any error or warning from the VI. You can wire error to the Error Cluster From Error Code VI to convert the error code or warning into an error cluster.

Contingency Table Details

The Contingency Table VI uses the 2 test of homogeneity and the 2 test of independence to test your hypothesis. Before testing your hypothesis, decide upon a minimum value for probability for each test. The minimum value you decide upon for probability is the value at which you accept or reject the hypothesis. Ordinarily, you want to choose a small value for probability. 0.05 is a common choice. If the actual value of probability returned by the VI is less than the value you decide upon, consider rejecting the hypothesis.

With the 2 test of homogeneity, the VI takes a random sample of some fixed size from each of the categories in one categorization scheme. For each of the samples, the VI categorizes the objects of experimentation according to the second scheme and tallies them. The VI tests the hypothesis to determine whether the populations from which each sample is taken are identically distributed with respect to the second categorization scheme.

With the 2 test of independence, the VI takes only one sample from the total population. The VI then categorizes each object and tallies it in two categorization schemes. The VI tests the hypothesis that the categorization schemes are independent.

Formulas

Let yp, q be the number of occurrences in the (pq)th cell of the contingency table for

p = 0, 1, …, (s – 1) and q = 0, 1, …, (k – 1),

where s is the number of rows in the Contingency Table, and k is the number of columns in the Contingency Table.

Let

The VI uses x to calculate the probability

p = Prob{X x}

where X is a random variable from the 2 distribution. If the hypothesis is true, x came from a 2 distribution with (s – 1) and (k – 1) degrees of freedom.