# Metadata Quality for Biobanks
## 6 Metadata Quality Characteristics and Metrics
### Metadata Coverage
#### 6.4.2 Calculating Metadata Coverage Metrics  
As we provided several definitions of metadata coverage above, we can describe several approaches to calculating coverage metric values. The first approach is to define metadata coverage as an absolute number of non-empty metadata values in a biobank on a certain aggregation level, e.g., connected to some collection or to a specific attribute. This way, the calculation of coverage metric values uses formulas similar to those used for completeness calculation, with the difference being that such metrics are absolute and not relative. For example, we define data attribute-scoped collection-level metadata coverage as _a total number of non-empty metadata values for a specific data item attribute in a specific collection_. Similarly to the corresponding completeness metric, such coverage metric could characterize the total number of all present metadata values (for all defined data item quality characteristics) for the patient age data item attribute for a specific collection (patient age reliability, patient age accuracy etc., taken together). It can be calculated as follows (see the explanation of the formula elements in the previous section):  
\[MCov_{ac}^{attr}=\sum_{s\in S_{c}}\sum_{a^{M}\in A_{c}^{M}}h_{sa}^{M}(a^{M}),a\ \in A_{c} \tag{7}\]  
where \(h_{sa}^{M}(a^{M})\) is a metadata value presence function which can be either 1 if the value for a metadata attribute \(a^{M}\in A_{c(s)}^{M}\) calculated for a data item attribute \(a\) is present for \(s\), or 0 otherwise. Suppose there is a collection \(c_{1}\) which contains 100 samples, out of which there are 70 samples with defined two metadata attribute values describing the patient age data item attribute values, and 30 samples with defined three metadata values describing the values instantiating the same data item attribute. Then \(MCov_{(age)c_{1}}^{attr}=70\cdot 2+30\cdot 3=220\). Other metadata coverage metrics belonging to this category can be calculated similarly based on the formulas for metadata completeness. Metadata Coverage as the Number of Attributes Holding Non-Empty Values  
Taking into account the definition of metadata coverage as the number of metadata attributes holding values on the specific aggregation level (e.g., for a collection), another approach to calculating coverage is to calculate the ratio of the number of metadata attributes for which the values are present for a collection \(c\) to the total number of metadata attributes defined for \(c\). This calculation can be made using the following formula:  
\[MCov_{c}^{a^{M}num}=\frac{\sum\limits_{a^{M}\in A_{c}^{M}}h_{c}^{M}(a^{M})}{n( A_{c}^{M})} \tag{8}\]  
where \(h_{c}^{M}(a^{M})\) is a presence function that is evaluated to 1 if the metadata attribute \(a^{M}\) contains the non-empty value for any of the samples belonging to a collection \(c\), 0 otherwise. Suppose the data item attribute values instantiated by the samples in a collection \(c_{1}\) are described by data item consistency, completeness, reliability, and provenance. Additionally, suppose that no data item completeness values are instantiated to describe data item attribute values for all the samples in \(c_{1}\), while values for the other three metadata attributes are instantiated to describe at least one data item attribute value for some sample in \(c_{1}\). Then \(MCov_{c_{1}}^{a^{M}num}=3/4=0.75\). Taking into account the definition of metadata coverage as the number of diverse values for an attribute on the specific aggregation level (e.g., for a collection), yet another approach to calculating coverage is to calculate _the number of diverse metadata values for a collection metadata attribute_. It is not always applicable for assessing the quality of quality metadata as the number of diverse values, e.g., for data item reliability, is not very informative.