Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.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;
};
const stErrorFunction = array =>
ss.sampleStandardDeviation(array) / Math.sqrt(array.length);
const stErrors = subjects.map(subject => {
const stErrorFunction = array =>
ss.sampleStandardDeviation(array) / Math.sqrt(array.length);
const stErrors = data_condition