q_calc_util 0.1.1

Q Calc Util #

Build 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
List<double> values = [0.764, 0.864, 0.936, 0.047, 1.028, 1.043];

try {
  // Calculates Q Test using 95% of confidence
  DixonResults 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.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) {
  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()}
  """);
}

main() {
  List<double> values = [0.764, 0.864, 0.936, 0.047, 1.028, 1.043];

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

  try {
    DixonResults result99 = calculateQTest(values, Confidence.percent99);
    printResults(result99);
  } 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.1

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 Jul 17, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19

Platforms

Detected platforms: Flutter, web, other

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

Dependencies

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

Admin