R code for analyzing 2-way and 3-way interactions

This code was used to compute chi-square values for all 2-way and 3-way interactions between the loci included in the analysis.