private void addDescriptiveStatistics(DescriptiveStatsDto descriptiveStats) { grid.clear(); grid.setHeader(0, translations.descriptiveStatistics()); grid.setHeader(1, translations.value()); int row = 0; addGridStat(translations.NLabel(), Math.round(descriptiveStats.getN()), row++); addGridStat(translations.min(), descriptiveStats.getMin(), row++); addGridStat(translations.max(), descriptiveStats.getMax(), row++); addGridStat(translations.meanLabel(), descriptiveStats.getMean(), row++); addGridStat(translations.geometricMeanLabel(), descriptiveStats.getGeometricMean(), row++); addGridStat(translations.median(), descriptiveStats.getMedian(), row++); addGridStat(translations.standardDeviationLabel(), descriptiveStats.getStdDev(), row++); addGridStat(translations.variance(), descriptiveStats.getVariance(), row++); addGridStat(translations.skewness(), descriptiveStats.getSkewness(), row++); addGridStat(translations.kurtosis(), descriptiveStats.getKurtosis(), row++); addGridStat(translations.sum(), descriptiveStats.getSum(), row++); addGridStat(translations.sumOfSquares(), descriptiveStats.getSumsq(), row++); }
private void addGridStat(String title, double number, int row) { NumberFormat nf = NumberFormat.getFormat("#.####"); grid.setWidget(row, 0, new Label(title)); grid.setWidget(row, 1, new Label(String.valueOf(nf.format(number)))); }