SimpleRegression implements Serializable, UpdatingMultipleLinearRegression { public void clear() { sumX = 0d; sumXX = 0d; sumY = 0d; sumYY = 0d; sumXY = 0d; n = 0; } SimpleRegression();  SimpleRegression(boolean includeIntercept); void addData(final double x,final double y); void append(SimpleRegression reg); void removeData(final double x,final double y); void addData(final double[][] data); void addObservation(final double[] x,final double y); void addObservations(final double[][] x,final double[] y); void removeData(double[][] data); void clear(); long getN(); double predict(final double x); double getIntercept(); boolean hasIntercept(); double getSlope(); double getSumSquaredErrors(); double getTotalSumSquares(); double getXSumSquares(); double getSumOfCrossProducts(); double getRegressionSumSquares(); double getMeanSquareError(); double getR(); double getRSquare(); double getInterceptStdErr(); double getSlopeStdErr(); double getSlopeConfidenceInterval(); double getSlopeConfidenceInterval(final double alpha); double getSignificance(); RegressionResults regress(); RegressionResults regress(int[] variablesToInclude);  }
@Test public void testClear() { SimpleRegression regression = new SimpleRegression(); regression.addData(corrData); Assert.assertEquals("number of observations", 17, regression.getN()); regression.clear(); Assert.assertEquals("number of observations", 0, regression.getN()); regression.addData(corrData); Assert.assertEquals("r-square", .896123, regression.getRSquare(), 10E-6); regression.addData(data); Assert.assertEquals("number of observations", 53, regression.getN()); }