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:
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));
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).
Please file feature requests and bugs at the issue tracker.
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.bignum
a runtime dependency (instead of
a dev dependency) 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));
}
You can install the package from the command line:
$ pub global activate t_stats
The package has the following executables:
$ t_stats
Add this to your package's pubspec.yaml file:
dependencies:
t_stats: ^2.0.0
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.
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 |
|
|
1.1.2 | Nov 23, 2017 |
|
|
1.1.1 | Mar 24, 2017 |
|
|
1.1.0 | Mar 24, 2017 |
|
|
1.0.0 | Mar 24, 2017 |
|
|
0.0.4 | Jun 15, 2016 |
|
|
0.0.3 | Jun 14, 2016 |
|
|
0.0.2 | Jun 14, 2016 |
|
|
0.0.1 | Jun 14, 2016 |
|
|
Popularity:
Describes how popular the package is relative to other packages.
[more]
|
20
|
Health:
Code health derived from static analysis.
[more]
|
100
|
Maintenance:
Reflects how tidy and up-to-date the package is.
[more]
|
100
|
Overall:
Weighted score of the above.
[more]
|
60
|
We analyzed this package on Feb 14, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:
Detected platforms: Flutter, web, other
No platform restriction found in primary library
package:t_stats/t_stats.dart
.
Fix lib/t_stats.dart
. (-0.50 points)
Analysis of lib/t_stats.dart
reported 1 hint:
line 62 col 33: Use =
to separate a named parameter from its default value.