来自Java ArrayList的描述性统计信息

时间:2013-01-10 23:50:57

标签: java google-app-engine arraylist

我有Profile对象的ArrayList。 Profile具有agegendercountry等属性。

java中是否有任何库可以轻松提供描述性统计数据,例如女性档案数量,男性档案数量,美国女性档案数量以及其他复杂报告。

使用的环境是Google App Engine。

由于

2 个答案:

答案 0 :(得分:4)

您可以在apache commons math中使用描述性统计数据,例如

// Get a DescriptiveStatistics instance
DescriptiveStatistics stats = new DescriptiveStatistics();

// Add the data from the array
for( int i = 0; i < inputArray.length; i++) {
        stats.addValue(inputArray[i]);
}

// Compute some statistics
double mean = stats.getMean();
double std = stats.getStandardDeviation();

您需要将性别/国家/地区信息添加到commons math提供的descriptiveStatistics中。希望它有所帮助。

答案 1 :(得分:1)

您可以使用像javascriptstats.com

这样的简单库

它特定于数字统计,具有以下功能:

  • 平均数
  • 中值
  • 模式
  • 范围
  • 方差
  • 标准偏差

干杯!