t_stats 1.1.2

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 63

t_stats

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.
print(myStat);

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

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.

Changelog

1.1.2

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

0.0.1

  • Initial version, created by Stagehand

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

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

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

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

  print(stats.isDifferentFrom(stats2));
  print(stats.isDifferentFrom(stats4));
}

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:


dependencies:
  t_stats: "^1.1.2"

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
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

Analysis

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

  • Dart: 2.0.0-dev.60.0
  • pana: 0.11.3

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
28 / 100
Health:
Code health derived from static analysis. [more]
98 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
63
Learn more about scoring.

Platforms

Detected platforms: Flutter, web, other

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

Suggestions

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 5 hints.

    Strong-mode analysis of lib/src/factorial.dart gave the following hint:

    line: 34 col: 35
    'LN2' is deprecated and shouldn't be used.

    Strong-mode analysis of lib/src/t_distribution.dart gave the following hint:

    line: 8 col: 12
    'NAN' is deprecated and shouldn't be used.

    Similar analysis of the following files failed:

    • lib/t_stats.dart (hint)

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.18.0 <2.0.0
bignum ^0.1.0 0.1.0
quiver ^0.26.2 0.26.2 0.29.0+1
Transitive dependencies
fixnum 0.10.7
matcher 0.12.2+1
meta 1.1.5
path 1.6.0
stack_trace 1.9.2
Dev dependencies
test >=0.12.0 <0.13.0