q_calc_util 0.1.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 50

Q Calc Util #

Build Status Coverage Status

Q Calc Util is a Dixon's Q Test library for Dart developers. It makes easier for developers to perform outliers check in a range between 3 and 30 values

Usage #

Add the following import to your Dart code:

import 'package:q_calc_util/q_calc_util.dart';

Then you can get a DixonResults object containing Q Test results just calling calculateQTest function like this:

// List of values to check outliers
var values = [0.764, 0.864, 0.936, 0.047, 1.028, 1.043];

try {
  // Calculates Q Test using 95% of confidence
  var result = calculateQTest(values, Confidence.percent95);

  print("""
        Confidence: 95%
         Lower end: ${result.lowerEnd.toStringAsFixed(3)}
         Upper end: ${result.upperEnd.toStringAsFixed(3)}
                 Q: ${result.q}
                 N: ${result.n}
            Values: ${result.values.toString()}
    Removed values: ${result.removedValues.toString()}
    """);
} on DixonException catch (error) {
  // Catches DixonException in case of 'n' lower than 3 values
  print(error.toString());
}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

0.1.2 #

  • Update code to match Pedantic recommendations
  • Fix examples

0.1.1+1 #

  • Update dependencies
  • Update CI/CD and coverage API

0.1.1 #

  • Fix error when n is out of bounds. Throws DixonException when not 3 < n =< 30

0.1.0 #

  • Initial release

example/q_calc_util_example.dart

import 'package:q_calc_util/q_calc_util.dart';

void printResults(DixonResults result, int confidence) {
  print('''
      Confidence: ${confidence}%
       Lower end: ${result.lowerEnd.toStringAsFixed(3)}
       Upper end: ${result.upperEnd.toStringAsFixed(3)}
               Q: ${result.q}
               N: ${result.n}
          Values: ${result.values.toString()}
  Removed values: ${result.removedValues.toString()}
  ''');
}

void main() {
  var values = [0.764, 0.864, 0.936, 0.047, 1.028, 1.043];

  try {
    var result95 = calculateQTest(values, Confidence.percent95);
    printResults(result95, 95);
  } on DixonException catch (error) {
    print(error.toString());
  }

  try {
    var result99 = calculateQTest(values, Confidence.percent99);
    printResults(result99, 99);
  } on DixonException catch (error) {
    print(error.toString());
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  q_calc_util: ^0.1.2

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

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

3. Import it

Now in your Dart code, you can use:


import 'package:q_calc_util/q_calc_util.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
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]
50
Learn more about scoring.

We analyzed this package on Feb 27, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
Dev dependencies
pedantic ^1.0.0
test ^1.9.4
test_coverage ^0.4.0