ropensci / coder

Classification of Cases into Deterministic Categories
https://docs.ropensci.org/coder/
22 stars 4 forks source link

Hantera dubbelräknade koder #58

Closed eribul closed 4 years ago

eribul commented 5 years ago

cancerpatienter kan ha koder som anger dels malignitet, dels solida tumörer (dvs olika koder). Ytterligara sådana fall finns. Då ska man eg inte räkna dubbelt utan endast den solida tumlren. Har hoittills ignorerat det men kanske egentligen borde hanteras.

eribul commented 4 years ago

Detta påverkar ju inte själva klassificeringen, däremot indexeringen!

eribul commented 4 years ago

Perhaps use an attached function as attribute with the classcodes object to be used jointly with index of corresponding name.

Could first calculate the index, then subtract part of it if conflicting categories are simultanously TRUE.

eribul commented 4 years ago

Solved a little differently. Each classcodes object might have a "hierarchy" attribute: a list vith character vectors, each a pair of superior and subordinate class nemes. First, the index is calculated as before, then the smallest absolute value is subtracted. This only applies for named index variables.