export function calculateSPC(data) {
  const mean = data.reduce((sum, value) => sum + value, 0) / data.length;
  const stdDev = Math.sqrt(data.reduce((sum, value) => sum + Math.pow(value - mean, 2), 0) / data.length);
  const UCL = mean + 3 * stdDev;
  const LCL = mean - 3 * stdDev;

  return { mean, UCL, LCL };
}
