Skip to content

Instantly share code, notes, and snippets.

@ellcom
Created June 8, 2026 13:32
Show Gist options
  • Select an option

  • Save ellcom/2eb70e3c12af8769325543dfe96668b4 to your computer and use it in GitHub Desktop.

Select an option

Save ellcom/2eb70e3c12af8769325543dfe96668b4 to your computer and use it in GitHub Desktop.
passmark linear transformation normalization
calculate_normalised_score <- function(passmark, score) {
normalised_score <- 50
if (score > passmark) {
normalised_score <- 50 + 50 * (
(score - passmark) / (100 - passmark)
)
} else if (score < passmark) {
normalised_score <- 50 - 50 * (
(passmark - score) / passmark
)
}
round(normalised_score)
}
calculate_normalised_score(60.28, 59.59)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment