# Metadata Quality for Biobanks
## 6 Metadata Quality Characteristics and Metrics
### Metadata Consistency
#### 6.5.2 Calculating Metadata Consistency Metrics  
In defining metadata consistency metrics, we follow the approach introduced in [10] to measure data item consistency and limit ourselves to calculating collection-level metadata consistency metrics. We define collection-level metadata consistency as _a reverse degree of variability with respect to the metadata standard within a collection_. This reflects that the collection metadata is more consistent if it conforms to fewer standards. Further in this section, we describe some collection-level consistency metrics. Metadata Attribute-Scoped Collection-Level Metadata Consistency Degree Based on the Number of Standards  
This metric is calculated based on the number of standards all metadata values instantiating a specific metadata attribute belonging to a collection conform to:  
\[MConsT_{a^{M}c}^{totA^{M}}=1-\frac{n(T_{a^{M}})}{\max_{a^{M}\in A^{M}_{c}}n(T_ {a^{M}})},a^{M}\in A^{M}_{c}, \tag{11}\]  
where \(T_{a^{M}}\) is a set of standards all metadata values instantiating the metadata attribute \(a^{M}\) conform to, \(A^{M}_{c}\) is a set of all metadata attributes declared for a collection \(c\). Suppose the data attribute values for the samples in a collection \(c_{1}\) are described by the data item consistency metadata attribute conforming to 2 standards, data item reliability metadata attribute conforming to 5 standards, and data item completeness metadata attribute conforming to 1 standard. Then, \(MConsT_{(consistency)c_{1}}^{totA^{M}}=1-2/\max(2,5,1)=0.6\). Metadata Attribute-Scoped Collection-Level Metadata Consistency Degree Based on the Most Frequently Applied Standard  
This metric is calculated as a ratio of the number of values instantiating a specific metadata attribute belonging to a biobank collection conforming to the most frequently applied standard to the total number of values instantiating this metadata attribute:  
\[MConsT_{a^{M}c}^{freqA^{M}}=\frac{\max_{t\in T_{a^{M}}}n(V_{ta^{M}}^{M})}{n(V_{ a^{M}}^{M})},a^{M}\in A^{M}_{c} \tag{12}\]  
where \(T_{a^{M}}\) is a set of standards all metadata values instantiating the metadata attribute \(a^{M}\) conform to, \(V_{a^{M}}^{M}\) is a full set of metadata values instantiating the metadata attribute \(a^{M}\) for the biobank collection, \(V_{ta^{M}}^{M}\) is a subset of this set consisting of the metadata values conforming to the standard \(t\). Suppose there are 100 data item completeness values describing data item attribute values in a collection \(c_{1}\), out of which 70 data item completeness values conform to the data item completeness standard S1, and 30 completeness values conform to the data item completeness standard S2. Then, \(MConsT_{(completeness)c_{1}}^{freqA^{M}}=\max(30,70)/100=0.7\). Metadata Attribute-Based Collection-Level Average Metadata Consistency Degree  
This metric is calculated as an average of the metadata attribute-scoped metadata consistency values for all metadata attributes declared for a collection:  
\[MConsT_{c}^{avgtotA^{M}}=\frac{\sum\limits_{a^{M}\in A^{M}_{c}}MConsT_{a^{M}}^{ totA^{M}}}{n(A^{M}_{c})}, \tag{13}\]  
or  
\[MConsT_{c}^{avgfreqA^{M}}=\frac{\sum\limits_{a^{M}\in A^{M}_{c}}MConsT_{a^{M}}^{ fregA^{M}}}{n(A^{M}_{c})}, \tag{14}\]Suppose the data attribute values for the samples in a collection \(c_{1}\) are described by the data item consistency metadata attribute conforming to 3 standards, data item reliability metadata attribute conforming to 5 standards, data item completeness metadata attribute conforming to 2 standards, and data item precision metadata attribute conforming to 1 standard. Then, \(MConsT_{c_{1}}^{ergotA\mathit{M}}=((1-3/\max(3,5,2,1))+(1-5/\max(3,5,2,1))+(1-2/ \max(3,5,2,1))+(1-1/\max(3,5,2,1)))/4=(0.4+0+0.6+0.8)/4=0.45\). Data Item Attribute-Based Metadata Consistency Metrics  
These metrics can be calculated, e.g., by aggregating consistency values for all metadata attributes assessing the quality of the values instantiating the specific data item attribute; we will not cover such metrics here due to the lack of space.