How to use the simple-statistics.sampleStandardDeviation function in simple-statistics

To help you get started, we’ve selected a few simple-statistics examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github makebrainwaves / BrainWaves / app / utils / behavior / compute.js View on Github external
.pop()
        .split('-')[2],
      reaction_time: Math.round(parseFloat(row.reaction_time)),
      correct_response: row.correct_response,
      trial_number: row.trial_number,
      response_given: row.response_given
    }));
  if (removeOutliers) {
    const mean = ss.mean(
      filteredData
        .filter(
          r => r.response_given === 'yes' && r.correct_response === 'true'
        )
        .map(r => r.reaction_time)
    );
    const standardDeviation = ss.sampleStandardDeviation(
      filteredData
        .filter(
          r => r.response_given === 'yes' && r.correct_response === 'true'
        )
        .map(r => r.reaction_time)
    );
    const upperBoarder = mean + 2 * standardDeviation;
    const lowerBoarder = mean - 2 * standardDeviation;
    filteredData = filteredData.filter(
      r =>
        (r.reaction_time > lowerBoarder && r.reaction_time < upperBoarder) ||
        isNaN(r.reaction_time)
    );
  }
  return filteredData;
};
github makebrainwaves / BrainWaves / app / utils / behavior / compute.js View on Github external
const stErrorFunction = array =>
          ss.sampleStandardDeviation(array) / Math.sqrt(array.length);
        const stErrors = subjects.map(subject => {
github makebrainwaves / BrainWaves / app / utils / behavior / compute.js View on Github external
const stErrorFunction = array =>
          ss.sampleStandardDeviation(array) / Math.sqrt(array.length);
        const stErrors = data_condition