getDisabilityStats = (forceName) => {
let forceStats = taserByDisability.filter((f) => f["Police Force"] === forceName)
let total = forceStats.find((f) => f.variable === "Total").value
let mental = forceStats.find((f) => f.variable === "Mental").value
let physical = forceStats.find((f) => f.variable === "Physical").value
let both = forceStats.find((f) => f.variable === "Both").value
let none = forceStats.find((f) => f.variable === "None").value
let notReported = forceStats.find((f) => f.variable === "Not reported").value
let hasDisability = total - none
let disabilityRatio = hasDisability / total
let mentalRatio = mental / total
let physicalRatio = physical / total
let bothRatio = both / total
let notReportedRatio = notReported / total
return {
force: forceName,
total: total,
totalDisability: hasDisability,
disabilityRatio: disabilityRatio,
mentalRatio: mentalRatio,
physicalRatio: physicalRatio,
notReportedRatio: notReportedRatio,
bothRatio: bothRatio
}
}