t_stats 2.0.0

  • README.md
  • Example
  • Installing
  • Versions
  • 50


Build status

This package provides a single class which computes things like standard deviation and margin of error. It should be useful whenever you have a list of numerical values and you want to:

  • show simple stats like mean, min and max, or
  • find out the confidence interval (at the standard 95% confidence level), or
  • confirm relationship to other measurements.

Library usage

A simple usage example:

var myStat = new Statistic.from(myMeasurements, name: "My scores");
// Prints the most basic stats.

var otherStat = new Statistic.from(otherMeasurements);
// Prints true only if stats are different with statistical significance.

Executable usage

You can install the simple binary by running the following in the command line:

pub global activate t_stats

Now you can use t_stats as a command line tool. Assuming there's a numbers.txt file that contains a line-delimited list of numbers, you can run:

$ t_stats --pretty < numbers.txt
    2.11  ±   2.48 MoE /   3.22 SD

This takes full advantage of POSIX pipes, so you can have things like:

$ <some_complicated_unix_command> | t_stats --pretty
    9.88  ±  12.21 MoE /  23.75 SD

If you don't provide the --pretty argument, the tool will print out the output of Statistic.toTSV() (less human-readable, but much more useful for comparing multiple sets of measurements).

Features and bugs

Please file feature requests and bugs at the issue tracker.



  • Upgrade to Dart 2
  • Use BigInt (found in dart:core) instead of package:bignum. This affects return values as well (factorial) so we're bumping major semver of this package to 2.0.


  • Upgrade to latest
  • Make the dependency to bignum a runtime dependency (instead of a dev dependency)


  • Initial version, created by Stagehand


// 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 =
      new Statistic.from([1, 1, 1, 10, 1, 5, 1, 100], name: "My scores");

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

  final stats3 =
      new Statistic.from(new Iterable.generate(2000, (n) => n).toList());

  final random = new Random();
  final stats4 = new Statistic.from(
      new Iterable.generate(2000, (_) => random.nextInt(100)).toList());


Use this package as an executable

1. Install it

You can install the package from the command line:

$ pub global activate t_stats

2. Use it

The package has the following executables:

$ t_stats

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  t_stats: ^2.0.0

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter packages get

Alternatively, your editor might support pub get or flutter packages get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:t_stats/t_stats.dart';
Version Uploaded Documentation Archive
2.0.0 Jul 23, 2018 Go to the documentation of t_stats 2.0.0 Download t_stats 2.0.0 archive
1.1.2 Nov 23, 2017 Go to the documentation of t_stats 1.1.2 Download t_stats 1.1.2 archive
1.1.1 Mar 24, 2017 Go to the documentation of t_stats 1.1.1 Download t_stats 1.1.1 archive
1.1.0 Mar 24, 2017 Go to the documentation of t_stats 1.1.0 Download t_stats 1.1.0 archive
1.0.0 Mar 24, 2017 Go to the documentation of t_stats 1.0.0 Download t_stats 1.0.0 archive
0.0.4 Jun 15, 2016 Go to the documentation of t_stats 0.0.4 Download t_stats 0.0.4 archive
0.0.3 Jun 14, 2016 Go to the documentation of t_stats 0.0.3 Download t_stats 0.0.3 archive
0.0.2 Jun 14, 2016 Go to the documentation of t_stats 0.0.2 Download t_stats 0.0.2 archive
0.0.1 Jun 14, 2016 Go to the documentation of t_stats 0.0.1 Download t_stats 0.0.1 archive
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Dec 5, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.1.0
  • pana: 0.12.7


Detected platforms: Flutter, web, other

No platform restriction found in primary library package:t_stats/t_stats.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.23.0 <3.0.0
quiver ^2.0.0 2.0.1
Transitive dependencies
matcher 0.12.4
meta 1.1.6
path 1.6.2
stack_trace 1.9.3
Dev dependencies
test ^1.3.0