Contingency Table Analysis
Description
This tool constructs a contingency table between two variables. Categories are constructed based on percentiles (see "Type of Contingency Table" under "Parameters" below for details), and a chi-squared test is run to determine whether the observed and expected frequencies are significantly different from one another. The output consists of the observed and expected frequencies and the p-value from the chi-squared test (null hypothesis = no difference between the observed and expected frequencies).
Input
File
Select the input data by clicking on "Browse" and navigating to the proper file.
Input Data Format
Year / Data
Each "/" is a tab (i.e., data should be tab-delimited). Missing Data should be denoted as "-99".
Start Row
Enter the row number where the main data to be processed begin in the input file selected above. An example of how row numbers are entered is shown in Figure 2 located in the Running Dendro Tools topic.
Variable 1 Column Number
This input is the column number where the data for the first variable are located in the input file selected above. An example of how column numbers are entered is shown in Figure 2 located in the Running Dendro Tools topic.
Variable 2 Column Number
This input is the column number where the data for the second variable are located in the input file selected above. An example of how column numbers are entered is shown in Figure 2 located in the Running Dendro Tools topic.
Output
File
Select or enter the name of the file where the results will be stored.
Header
Information entered here will be output in the first line of the output file.
Parameters
Start Year
Enter the year to start the analysis.
End Year
Enter the year to end the analysis.
Type of Contingency Table
Select whether to construct a 2 x 2 or 4 x 4 contingency table. A 2 x 2 contingency table is selected by default. If 2 x 2 is selected, Dendro Tools will compute frequencies based on two categories: <=50th percentile and >50th percentile. If 4 x 4 is selected, Dendro Tools will compute frequencies based on four categories: <=25th percentile, >25th and <=50th percentiles, >50th and <=75th percentiles, and >75th percentile.
Output Contingency Table
How to Read the Output
Once the contingency table analysis tool has been run, the output file is read into Dendro Tools and displayed for the user to scroll through (Fig. 1). The row and column names with "25th", "50th", and "75th", refer to the 25th, 50th, and 75th percentiles, respectively.
![]() |
Figure 1. The results from the contingency table analysis are output to the output file and displayed under "Output Contingency Table" as shown above. The two variables are denoted as "Column Variable" and "Row Variable", respectively. The "Column Variable" increases from left to right across the top of the tables (boxed in red), and the "Row Variable" increases from top to bottom (boxed in orange). |