import java.text.*; import com.imsl.stat.*; import com.imsl.math.PrintMatrix; import com.imsl.math.PrintMatrixFormat; public class ANOVAFactorialEx1 { public static void main(String args[]) { int nSubscripts = 3; int[] nLevels = {3, 2, 10}; double[] y = { 73.0, 102.0, 118.0, 104.0, 81.0, 107.0, 100.0, 87.0, 117.0, 111.0, 90.0, 76.0, 90.0, 64.0, 86.0, 51.0, 72.0, 90.0, 95.0, 78.0, 98.0, 74.0, 56.0, 111.0, 95.0, 88.0, 82.0, 77.0, 86.0, 92.0, 107.0, 95.0, 97.0, 80.0, 98.0, 74.0, 74.0, 67.0, 89.0, 58.0, 94.0, 79.0, 96.0, 98.0, 102.0, 102.0, 108.0, 91.0, 120.0, 105.0, 49.0, 82.0, 73.0, 86.0, 81.0, 97.0, 106.0, 70.0, 61.0, 82.0 }; NumberFormat nf = NumberFormat.getInstance(); nf.setMaximumFractionDigits(6); ANOVAFactorial af = new ANOVAFactorial(nSubscripts, nLevels, y); System.out.println("P-value = " + nf.format(af.compute())); } }