# Metadata Quality for Biobanks
## 6 Metadata Quality Characteristics and Metrics
### Metadata Conformance to Expectations
#### 6.9.2 Calculating Metadata Conformance to Expectations Metrics  
Following [PERSON] and [PERSON] [26], we define conformance to expectations metrics (contributing to findability) to be based on _the relative amount of unique information contained in the metadata element_. For example, if all metadata elements for average BMI reliability of the available biobank collections contain the value of 1 (i.e., indicating that BMI data for these collections is 100% reliable), adding a new metadata element with the value of 1 cannot help in distinguishing the corresponding biobank collection from the rest, whereas a new element holding the value of 0.5 (indicating that BMI data for this collection is 50% reliable) helps to find the corresponding collection much easier, as this value is unique in the set of metadata elements available for search. To assess such uniqueness, again following [PERSON] and [PERSON] [26], we use the concept of _entropy_, defined, based on [PERSON] [60], as the reverse measure (negative logarithm) of the probability of encountering a specific value in a set, i.e., the degree of \"non-standardness\" of this value for this set. Calculating Metadata Attribute Value Uniqueness  
We start with defining the metric for metadata attribute value uniqueness. Suppose we have the metadata attribute which holds values belonging to a finite set (e.g., the data item reliability, which is assessed by humans on the interval from 0 to 1 with the step of 0.1, defining the set of 11 values: {0, 0.1,..., 0.9, 1}). Now we can assess the uniqueness of the metadata values instantiating that metadata attribute to describe the values of different data item attributes instantiated by different samples by calculating their entropy. It can be done using the following formula:  
\[MUniq_{c}(a^{M},a,s)=1-\frac{\log(Num^{M}_{A_{c}S_{c}}(v_{a^{M}}(a,s)))}{\log(n (A_{c})\cdot n(S_{c}))},s\in S_{c},a\ \in A_{c},a^{M}\in A^{M} \tag{26}\]  
where \(v_{a^{M}}(a,s)\) is a value of the metadata attribute \(a^{M}\) describing the value of the data item attribute \(a\) instantiated for the sample \(s\), \(A_{c}\) is a set of all data item attributes defined for a biobank collection \(c\), \(S_{c}\) is a set of all samples in \(c\), \(Num^{M}_{A_{c}S_{c}}(v_{a^{M}}(a,s))\) is the total number of values equal to \(v_{a^{M}}(a,s)\) in the set of values for the metadata attribute \(a^{M}\) describing the values of all data item attributes in \(A_{c}\) instantiated for all samples in \(S_{c}\). If \(Num^{M}_{A_{c}S_{c}}(v_{a^{M}}(a,s))=0\) (which means that \(v_{a^{M}}(a,s)\) is not present in the set of values for \(a^{M}\)), the Formula (26) is evaluated to 1, if \(Num^{M}_{A_{c}S_{c}}(v_{a^{M}}(a,s))=n(S_{c})\cdot n(A_{c})\) (all data item attributes in \(A_{c}\) instantiated by all the samples in \(S_{c}\) are described by the same \(v_{a^{M}}(a,s)\) metadata value for \(a^{M}\)), this formula is evaluated to 0. The above metric allows for assessing the conformance to expectations for the given metadata attribute value describing a data item attribute value instantiated for a specific sample. Suppose a collection \(c_{1}\) contains 100 samples, each instantiating patient age, disease code, and BMI data item attributes described, in turn, by data item reliability, and consistency metadata attributes. Suppose also that the value of 0.5 for the data item consistency metadata attribute describing BMI data item attribute for the sample \(s_{1}\) is equal to the data item consistency values describing in total 210 data item attribute values. Then, \(MUniq_{c_{1}}(consistency,BMI,s1)=1-\log(210)/\log(3\cdot 100)\). Calculating Aggregated Metadata Attribute Value Uniqueness for a Collection  
It is also possible to calculate the aggregated uniqueness of metadata attribute values for a collection.