Accident Rate Calculation Formula

Accident Rate Calculator

This calculator helps you determine the accident rate for a given period. The accident rate is typically calculated as the number of accidents per a specific unit of exposure (e.g., per 100,000 hours worked, per 1 million miles driven). A lower accident rate generally indicates better safety performance.

Accident Rate:

function calculateAccidentRate() { var numberOfAccidentsInput = document.getElementById("numberOfAccidents"); var exposureUnitInput = document.getElementById("exposureUnit"); var rateMultiplierInput = document.getElementById("rateMultiplier"); var accidentRateOutput = document.getElementById("accidentRateOutput"); var numberOfAccidents = parseFloat(numberOfAccidentsInput.value); var exposureUnit = parseFloat(exposureUnitInput.value); var rateMultiplier = parseFloat(rateMultiplierInput.value); accidentRateOutput.textContent = ""; // Clear previous results if (isNaN(numberOfAccidents) || isNaN(exposureUnit) || isNaN(rateMultiplier)) { accidentRateOutput.textContent = "Please enter valid numbers for all fields."; return; } if (exposureUnit <= 0) { accidentRateOutput.textContent = "Exposure units must be greater than zero."; return; } var accidentRate = (numberOfAccidents / exposureUnit) * rateMultiplier; accidentRateOutput.textContent = accidentRate.toFixed(2) + " per " + rateMultiplier + " exposure units"; } #accidentRateCalculator { font-family: sans-serif; border: 1px solid #ccc; padding: 20px; border-radius: 8px; max-width: 500px; margin: 20px auto; box-shadow: 0 2px 4px rgba(0,0,0,0.1); } #accidentRateCalculator h2 { text-align: center; margin-bottom: 20px; color: #333; } .calculator-inputs { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-bottom: 20px; } .input-group { display: flex; flex-direction: column; } .input-group label { margin-bottom: 5px; font-weight: bold; color: #555; } .input-group input { padding: 10px; border: 1px solid #ddd; border-radius: 4px; font-size: 1rem; width: calc(100% – 20px); /* Adjust for padding */ } button { display: block; width: 100%; padding: 12px 20px; background-color: #007bff; color: white; border: none; border-radius: 5px; font-size: 1.1rem; cursor: pointer; transition: background-color 0.3s ease; margin-top: 10px; } button:hover { background-color: #0056b3; } #result { margin-top: 25px; padding-top: 15px; border-top: 1px solid #eee; } #result h3 { margin-bottom: 10px; color: #333; } #accidentRateOutput { font-size: 1.2rem; font-weight: bold; color: #28a745; }

Leave a Comment