t_stats 4.0.0 copy "t_stats: ^4.0.0" to clipboard
t_stats: ^4.0.0 copied to clipboard

A micro-library for statistics, especially for comparing samples.

example/example.dart

// Copyright (c) 2016, Filip Hracek. All rights reserved. Use of this source
// code is governed by a BSD-style license that can be found in the LICENSE
// file.

import 'dart:math';

import 'package:t_stats/t_stats.dart';

void main() {
  final stats = Statistic.from([1, 1, 1, 10, 1, 5, 1, 100], name: "My scores");
  print(stats);

  final stats2 = Statistic.from([
    24,
    14,
    20,
    24,
    21,
    21,
    19,
    29,
  ], name: "Your scores");
  print(stats2);

  final stats3 = Statistic.from(
    Iterable.generate(2000, (n) => n).toList(),
    name: "Linear count",
  );
  print(stats3);

  final random = Random();
  final stats4 = Statistic.from(
    Iterable.generate(2000, (_) => random.nextInt(100)).toList(),
    name: "Random.nextInt(100)",
  );
  print(stats4);
  final stats5 = Statistic.from(
    Iterable.generate(2000, (_) => random.nextInt(100) + 1).toList(),
    name: "Random.nextInt(100) + 1",
  );
  print(stats5);

  print(stats.isDifferentFrom(stats2));
  print(stats.isDifferentFrom(stats4));
  print(stats4.isDifferentFrom(stats5));
}
3
likes
160
points
738
downloads

Publisher

verified publisherfiliph.net

Weekly Downloads

A micro-library for statistics, especially for comparing samples.

Repository (GitHub)

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

meta

More

Packages that depend on t_stats