Skip to content

feat(concordance): add minor error (mE) metric#111

Open
efosternyarko wants to merge 1 commit into
AMRverse:mainfrom
efosternyarko:feat/concordance-minor-errors
Open

feat(concordance): add minor error (mE) metric#111
efosternyarko wants to merge 1 commit into
AMRverse:mainfrom
efosternyarko:feat/concordance-minor-errors

Conversation

@efosternyarko
Copy link
Copy Markdown
Collaborator

Summary

  • Adds mE (minor error) to concordance() and concordance_from_tables(), as defined by Wanger et al. (1999) / ISO 20776-2
  • For the R outcome: mE = proportion of intermediate (I) isolates predicted as resistant — count(I=1 & pred=1) / count(I=1)
  • Returns NA for the NWT outcome (no intermediate ECOFF category) and when no I column is present
  • concordance_from_tables() now encodes a binary I column from the observed SIR calls so mE flows through the per-drug concordance() call automatically, capturing true=I, predicted=R discordances
  • print.amr_concordance() conditionally displays mE only when non-NA

Closes #109

Test plan

  • concordance() with a binary matrix containing an I column: check mE is computed and printed under the R outcome
  • concordance() for NWT outcome: check mE is NA and not printed
  • concordance() with no I column: check mE is NA
  • concordance_from_tables(): check mE appears in metrics for drugs with intermediate isolates

Adds mE (minor error) to concordance() and concordance_from_tables() as
defined by Wanger et al. (1999) / ISO 20776-2: proportion of intermediate
(I) isolates genotypically predicted as resistant. Computed as
count(I=1 & pred=1) / count(I=1) for the R outcome when an I column is
present; NA for NWT (no intermediate ECOFF category).

Closes AMRverse#109
@efosternyarko
Copy link
Copy Markdown
Collaborator Author

@katholt this is ready for your review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add minor errors to concordance function

1 participant