Sitemap

๐Œ๐ข๐ฌ๐ฌ๐ข๐ง๐  ๐๐š๐ญ๐š ๐Ÿ๐ŸŽ๐Ÿ โ€” ๐ฅ๐ž๐ญโ€™๐ฌ ๐ญ๐ก๐ข๐ง๐ค ๐Ÿ๐จ๐ซ ๐š ๐ฆ๐ข๐ง๐ฎ๐ญ๐ž ๐›๐ž๐Ÿ๐จ๐ซ๐ž ๐ฐ๐ž ๐š๐œ๐ญ

19 min readAug 11, 2023

--

Press enter or click to view image in full size
Figure 1: Generated with DALLยทE prompt: โ€” 3D render comics style picture of a scene where a superhero data scientist is fighting data generators and fixing bad data. very colorful. HQ. Very detailed.

In the realms of comics, while there are numerous scientists villains, the concept of an evil data scientist is distinctly absent. This observation leads us to a compelling conclusion: without data, a data scientist is essentially just a scientist, with a heightened likelihood of turning to the dark side.

Unfortunately, the issue of missing data is a pervasive problem in the field of data science. Clearly, the absence of data can have a substantial impact on the reliability and validity of any analysis conducted. Various approaches exist to address missing data, including discarding incomplete records or employing statistical techniques to impute the missing values. However, it is crucial to first comprehend the data generation process before determining the most suitable method to handle missing data.

Welcome to this article, where we will explore the fundamental concepts of missing data. Please note that the intent of this article is not to provide fancy code or sophisticated imputation algorithms for filling in missing data. The internet is full with excellent resources that offer code and explanations for a wide array of techniques, ranging from traditional methods like complete case analysis and imputation to more advanced approaches such as multiple imputation and model-based techniques. Instead, our focus will be on the critical step of understanding WHY data is missing before delving into HOW to handle it. Unfortunately, this essential step is frequently overlooked in many online guides.

We will commence by examining the process through which data is generated, followed by an exploration of the causes of missing data. By understanding these aspects, we can determine the appropriate course of action. So, if you possess a genuine interest in acquiring a deeper understanding of the underlying reasons behind missing data and wish to gain insight into the essential connections between these reasons and the techniques employed to address them, then this article is tailor-made for you. Letโ€™s get started!

Introduction

As established before, data is the data scientistโ€™s main โ€œspiceโ€. It is the foundation of any analysis we perform, and without it, our hands are tied. We rely on data to make informed decisions, develop insights, and create models that help us understand the world around us. However, not all data is perfect, and it is not uncommon to encounter missing data in our datasets, to phrase gently. In this article, we will explore the basics of missing data and how we can handle it to ensure that our analyses are as accurate and reliable as possible.

Understand First, Act Later

Before we jump into HOW to handle missing data, it is important to understand WHY the data is missing in the first place. This critical step is too often overlooked. And, it actually takes us back to the foundations of Philosophy of Science, distinguishing between patterns and processes. Patterns are the observed phenomena, while processes are the underlying mechanisms that give rise to these patterns. A perfect example is the famous story of Abraham Wald during WW2.

Abraham Wald, a prominent statistician, made significant contributions to the understanding of missing data during his work on the Statistical Research Group (SRG) in the 1940s. The SRG was a team of mathematicians, statisticians, and social scientists who were tasked with providing statistical insights to aid the United States military during World War II.

Waldโ€™s remarkable insight came from the analysis of damage to military aircraft returning from combat missions. Intuitively, the military sought to reinforce the planes by adding armor to the areas that were most frequently hit. However, they overlooked an important fact: the available data on the locations of the damages were only from the aircraft that returned safely. The locations of damages on the aircraft that were shot down and did not return were missing from the dataset.

Wald realized that the missing data on the locations of damages held valuable information. Rather than focusing solely on the observed patterns in the returning planes, he considered the underlying process that generated those patterns. He recognized that the missing data on the downed planes were not randomly distributed but were, in fact, systematically determined by the process of damage distribution.

Press enter or click to view image in full size
Figure 2: This hypothetical pattern of damage of surviving aircraft shows locations where they can sustain damage and still return home. If the aircraft was reinforced in the most commonly hit areas, this would be a result of survivorship bias because crucial data from fatally damaged planes was being ignored; those hit in other places did not survive. (Credit: Illustration of hypothetical damage pattern on a WW2 bomber. Based on a not-illustrated report by Abraham Wald (1943), picture concept by Cameron Moll (2005, claimed on Twitter and credited by Mother Jones), new version by McGeddon based on a Lockheed PV-1 Ventura drawing (2016), vector file by Martin Grandjean (2021).)

By understanding the process behind the missing data, Wald arrived at a counterintuitive conclusion. He recommended reinforcing the areas of the aircraft that showed no or minimal damage in the returning planes. His reasoning was as follows: if the planes that returned safely had damages concentrated in specific areas while other areas remained relatively intact, it implied that those intact areas were critical for the planesโ€™ survival. In contrast, the absence of damages in those areas on the downed planes indicated that damage to those regions was likely catastrophic, leading to the loss of the aircraft.

This example from Waldโ€™s work showcases the importance of comprehending the underlying mechanisms or processes that generate missing data. It highlights that missing data is not always a result of randomness or negligence but can be systematically tied to the phenomenon being observed. By recognizing this, data scientists can devise appropriate strategies to handle missing data and make informed inferences.

There are many reasons why data might be missing, ranging from human error during data collection to technical issues during data transfer and/or curation. Understanding the reason for missing data is probably the most essential step in determining how to handle it.

Sometimes, missing data can be due to a specific business logic. For example, in a survey where participants were asked to provide their income, some may choose not to answer due to privacy concerns. In other cases, data may be missing at random, such as when a sensor fails to record a reading.

The implications of missing data can vary depending on the reason for its absence. If data is missing at random, it may not have a significant impact on our analysis. However, if data is missing due to a specific business logic, the missing values may be related to other variables in the dataset. In this case, ignoring the missing data or replacing it with a default value could significantly bias our results. Therefore, it is crucial to carefully examine the reason for missing data and its potential impact on our analysis before deciding on a strategy to handle it.

Data Generating Process (DGP)

In this section, we will discuss the importance of understanding the data generating process (DGP) and how it can inform the handling of missing data. We will explore different domains and their respective DGPs to understand the nature of missing data patterns. By categorizing and analyzing these patterns, we can identify suitable methods for handling missing data. Overall, this article aims to highlight the importance of domain knowledge in handling missing data and showcase the benefits of understanding the process that generates the data.

The Process That Generates Data

The data generating process (DGP) refers to the process by which the observed data is generated. Understanding the DGP is crucial in identifying the missing data patterns and selecting the appropriate method to handle missing data.

Different domains have different DGPs, each with unique characteristics that impact the missing data patterns. For example, in medical research, the DGP may involve patients dropping out of a study due to adverse side effects or non-adherence to the treatment protocol. In social science, the DGP may involve survey respondents refusing to answer certain questions due to their sensitive nature. In finance, the DGP may involve stock prices being missing due to market closures or holidays.

By understanding the DGP, we can predict the types of missing data patterns that are likely to occur and design appropriate data collection methods.

Categorization of Missing Data Patterns Cross-Domain

Although the nature of the data generating process (DGP) can impact the missing data patterns in each domain, there are still common patterns of missing data that can occur across domains. By categorizing these patterns, we can identify generalizable methods for handling missing data.

One common pattern of missing data is missing completely at random (MCAR), where the missingness is independent of both the observed and unobserved data. In this case, the missing data can be safely ignored as long as the missingness rate is low.

Another common pattern of missing data is missing at random (MAR), where the missingness depends only on the observed data. In this case, we can use methods such as multiple imputation or maximum likelihood estimation to handle the missing data.

A third pattern of missing data is missing not at random (MNAR), where the missingness depends on the unobserved data. This can make imputation challenging as the missing data cannot be predicted based on the observed data alone. In this case, we may use sensitivity analysis or pattern-mixture models to handle the missing data.

Furthermore, there are also patterns of missing data that are domain-specific. For example, in medical research, missing data can occur due to patients dropping out of a study. In social science, missing data can occur due to survey non-response. In finance, missing data can occur due to stock prices being missing due to market closures.

By categorizing missing data patterns cross-domain, we can identify generalizable methods for handling missing data, as well as domain-specific methods. This can help us to handle missing data more effectively and accurately.

Common Causes of Missing Data

Now that we understand more about the DGPs and general missing data patterns (MCAR, MAR and MNAR) letโ€™s dive deeper into the mechanisms behind specific DGPs. We are still on our pursue for the root cause of missing data. This information will enable us to act knowledgably and properly.

There are many reasons why data may be missing from a dataset. Some of the most common causes include:

  • Survey non-response: In survey research, some participants may choose not to answer certain questions or may not complete the survey at all, leading to missing data.
  • Equipment malfunctions: In scientific research, equipment malfunctions can sometimes result in missing data, particularly in fields such as biology or physics where experiments may require precise measurements.
  • Data entry errors: Errors in data entry can result in missing data if certain values are not recorded or if data is recorded in the wrong format.
  • Systematic exclusions: Sometimes, certain groups of participants may be systematically excluded from a study or analysis, leading to missing data.
  • Data loss: Data may be lost due to technical issues or accidental deletion, resulting in missing data.

Understanding the reasons for missing data can help us choose the most appropriate method for handling the missing values in our dataset. By considering the source of the missing data, we can make informed decisions about how to handle it and avoid bias in our analysis.

Press enter or click to view image in full size

Missing data use cases in fighting FinCrime

For motivation, here are some examples of different causes of missing data in the financial transactions domain, and their related implications:

  1. Survey non-response: In the context of anti-fraud and AML, survey non-response can occur when customers or clients refuse to provide information or fail to respond to requests for information. This can make it difficult to assess the risk associated with a particular transaction or customer. It can also lead to incomplete or inaccurate customer profiles, which can make it more difficult to identify suspicious activity.
  2. Equipment malfunctions: Equipment malfunctions can cause data to be missing or incomplete. For example, a malfunctioning ATM might fail to record a transaction, or a point-of-sale terminal might fail to capture all of the necessary data for a transaction. This can make it difficult to reconcile accounts or identify fraudulent activity. Itโ€™s important for financial institutions to have contingency plans in place to address equipment malfunctions and minimize the impact on data integrity.
  3. Data entry errors: Data entry errors can occur when data is entered incorrectly or incompletely. For example, a customerโ€™s name might be misspelled, or a transaction might be recorded with the wrong amount. Data entry errors can lead to incorrect data being used to assess risk or identify suspicious activity, which can have serious implications for anti-fraud and AML efforts. Itโ€™s important for financial institutions to have quality control measures in place to prevent data entry errors, such as double-checking data entry or using automated data validation tools.
  4. Systematic exclusions: Systematic exclusions occur when certain data points are excluded from the dataset based on a predefined set of criteria. This can occur due to data processing rules, or because certain individuals or groups are intentionally excluded from the study. In the context of anti-fraud and AML, a common example of systematic exclusions is when a financial institution changes vendors for data enrichment without notifying the relevant stakeholders. This can result in missing data due to differences in data formats, field names, or other discrepancies between the old and new vendorsโ€™ data. This missing data can impact the accuracy and effectiveness of anti-fraud and AML measures, as it may result in incomplete or inconsistent information, hindering the institutionโ€™s ability to detect and prevent fraudulent transactions or money laundering activities.
  5. Data loss: Data loss can occur due to a variety of factors, such as hardware failures, cyberattacks, or natural disasters. Data loss can have serious implications for anti-fraud and AML efforts, as it can lead to gaps in data that are needed to assess risk or identify suspicious activity. Itโ€™s important for financial institutions to have backup systems in place to prevent data loss and ensure that data is properly secured and protected.

By understanding these common causes of missing data and their implications, financial institutions can take steps to minimize their impact and improve the accuracy and effectiveness of their anti-fraud and AML efforts.

Get YoavAvneonโ€™s stories inย yourย inbox

Join Medium for free to get updates fromย thisย writer.

Correlated Patterns between DGP and Missing Data Patterns

By examining the patterns of missing data in a dataset and understanding the DGP, we can identify correlated patterns between the two. This can help us understand why the data is missing and select appropriate methods to handle the missing data.

For example, if missing data is related to the characteristics of the participants in a medical study, we may use multiple imputation methods that incorporate these characteristics to impute missing values. Alternatively, if the missing data is due to technical errors in data collection, we may use data cleaning techniques to correct these errors.

Furthermore, by examining correlated patterns across different domains, we can identify generalizable methods for handling missing data. For example, in many domains, missing data occurs due to survey non-response. In these cases, we may use techniques such as imputation by the response propensity score or weighting-based imputation to handle missing data.

Overall, identifying correlated patterns between the DGP and missing data patterns can help us understand why data is missing and select appropriate methods for handling the missing data. In the next section, we will discuss the categorization of missing data patterns cross-domain. In the next section, we will explore how we can view missing data as sparse data and leverage this perspective to handle missing data.

Viewing Missing Data as Sparse Data

In some cases, missing data can be viewed as sparse data, where the missing values contain important information. By leveraging this perspective, we can handle missing data more effectively.

For example, in recommendation systems, missing data can occur when a user has not rated a particular item. Instead of imputing the missing values, we can view the missing values as informative and use methods such as matrix factorization or collaborative filtering to make recommendations based on the observed data.

Similarly, in image or signal processing, missing data can occur when certain pixels or measurements are missing. Instead of simply dropping or imputing these missing values, we can view them as a natural sparsification of the data by its generating process. By leveraging this perspective, we can use techniques such as compressed sensing or low-rank matrix completion to recover the missing data and obtain a more complete picture of the underlying signal or image.

In recent years, generative AI models, such as diffusion models, have shown promise for handling missing data. These models are able to learn the distribution of the data and generate realistic samples, even when some of the data is missing. By leveraging these models, we can effectively handle missing data and generate plausible samples that can be used for downstream analyses.

By viewing missing data as sparse data and leveraging the power of generative AI models, we can handle missing data more effectively and accurately. This can lead to better performance and accuracy in downstream analyses.

In conclusion, understanding the process that generates the observed pattern of missing data is crucial for selecting appropriate methods to handle the missing data. By examining the correlated patterns between the DGP and missing data patterns, categorizing missing data patterns cross-domain, and viewing missing data as sparse data, we can handle missing data more effectively and accurately, including through the use of generative AI models such as diffusion models.

Selected Imputation Methods

Imputation is the process of filling in missing data with estimated values based on the available data. There are several methods for imputing missing data, here are some I selected:

  1. Mean/median/mode imputation: This involves filling in the missing values with the mean, median, or mode value of the non-missing values for that variable. This method is simple to implement and can work well for variables with a small number of missing values or when the distribution of the data is approximately normal. However, it can lead to biased results if the missing data are not missing at random or if the variable has extreme outliers.
  2. Hot deck imputation: This involves filling in the missing values with values from other similar observations in the dataset. Hot deck imputation is similar to k-NN imputation, but instead of using the average of the k-nearest neighbors, we use a randomly selected value from the k-nearest neighbors. This method works well when the missing values are missing at random and when we have enough similar observations to impute the missing values.
  3. Regression imputation: This involves predicting the missing values using a regression model. We use the other variables in the dataset as predictors to estimate the missing values. This method can work well for variables that have a linear relationship with other variables in the dataset, but can be less effective for non-linear relationships or when there are too many missing values.
  4. Probability Density Function (PDF) imputation: This involves using the PDF of the available data to estimate the missing values. The PDF provides information about the distribution of the data, which can be used to generate plausible values for the missing data. This method works well when the missing data are missing at random and when the data are approximately normally distributed.
  5. Principal Component Analysis (PCA) imputation: This involves using PCA to reduce the dimensionality of the data and imputing missing values based on the reduced dataset. PCA can help to identify patterns in the data and reduce the impact of noise and outliers. This method works well when the missing data are missing at random and when the data have a strong correlation structure.
  6. Multiple imputation: This involves generating multiple plausible values for each missing data point using a probabilistic model. The imputations are combined to create a single imputed dataset. Multiple imputation is often considered the gold standard for imputation because it accounts for the uncertainty in the imputed values and provides a more accurate estimate of the standard errors for subsequent analyses.
  7. Time series imputation: This involves imputing missing values in time series data based on the patterns observed in the historical data. Methods such as linear interpolation, seasonal decomposition of time series (STL), or autoregressive integrated moving average (ARIMA) can be used for time series imputation. This method is particularly useful for imputing missing values in longitudinal or panel data where observations are collected over time.
  8. Machine learning-based imputation: This involves using machine learning algorithms, such as decision trees, random forests, or support vector machines, to predict missing values based on the patterns observed in the available data. Machine learning-based imputation can be effective for imputing missing values in complex datasets with non-linear relationships and interactions among variables.
  9. Cluster-based imputation: This involves grouping similar observations together based on their similarity in terms of the available data and using the values from the same cluster to impute the missing values. Cluster-based imputation can work well when there are distinct subpopulations or clusters within the dataset, and the missing values are imputed based on the values from the same cluster.
  10. Bayesian imputation: This involves using Bayesian statistical methods to estimate the missing values by incorporating prior knowledge or assumptions about the distribution of the data. Bayesian imputation can provide a flexible and robust approach to imputing missing values, especially when there is uncertainty about the true values of the missing data.
  11. Deep learning-based imputation: This involves using deep learning algorithms, such as autoencoders or recurrent neural networks, to learn patterns from the available data and generate imputed values for the missing data. Deep learning-based imputation can be effective for handling complex datasets with large amounts of missing data or when there are complex interactions among variables.
  12. Domain-specific imputation: This involves using domain-specific knowledge or expert judgment to impute missing values based on the context of the data. Domain-specific imputation can be useful when there is specific knowledge about the relationships or patterns in the data that can guide the imputation process. This method can be particularly effective in fields such as healthcare, finance, or social sciences where domain expertise is important for accurate imputation.
  13. Pattern recognition-based imputation: This involves identifying patterns or rules in the available data and using them to impute the missing values. For example, association rule mining or decision tree-based methods can be used to identify patterns or rules in the data and use them to impute the missing values. Pattern recognition-based imputation can work well when there are clear patterns or rules in the data that can be used for imputation.

As always in real life, no single imputation method is perfect, and each method has its own strengths and limitations. We should carefully evaluate the nature of the missing data, the assumptions of each imputation method, and the impact of the imputation on our analysis results before choosing an appropriate technique for handling missing data in our dataset. Additionally, we should consider the potential consequences of imputing missing data, such as introducing bias or distorting the distribution of the data. In some cases, it may be more appropriate to simply remove the missing data or to collect additional data to reduce the amount of missing data in our dataset.

General Best Practices for Handling Missing Data

Handling missing data is a critical part of data analysis, and itโ€™s essential to follow best practices to ensure the accuracy and reliability of our results. Incorporating domain knowledge into our imputation methods is an important best practice that can help improve the accuracy of our analysis. Hereโ€™s why:

  1. Use domain knowledge: Incorporating domain knowledge into our analysis can help us understand the underlying processes and mechanisms that generated the missing data. This understanding can guide us in deciding how to handle the missing data, whether itโ€™s appropriate to drop the missing data, impute it, or take some other action. For example, if we know that missing values in a particular variable are related to another variable, we can use that information to guide our imputation method. By using domain knowledge to guide our analysis, we can improve the accuracy and reliability of our results.
  2. Evaluate the reasons for missing data: As we discussed earlier, missing data can result from a variety of sources, and itโ€™s essential to evaluate the reason for the missing data before deciding on an imputation method. This can help us identify potential biases in our analysis and choose an appropriate imputation method.
  3. Consider the impact of imputation methods on analysis results: Different imputation methods can lead to different results, and itโ€™s important to evaluate the impact of the imputation method on our analysis results. We should also consider the sensitivity of our conclusions to the choice of imputation method.
  4. Prevent missing data when possible: We can reduce the amount of missing data by implementing quality control measures to reduce data entry errors and ensuring that our equipment is functioning correctly. We can also implement backup systems to prevent data loss in case of equipment failures.
  5. Document the handling of missing data: Itโ€™s important to document the methods used for handling missing data in our analysis. This documentation can help us validate our results and ensure reproducibility.
  6. Use multiple imputation techniques: When dealing with missing data, itโ€™s a good practice to use multiple imputation techniques to impute missing values. This can help reduce the risk of bias and increase the accuracy of our analysis. We can compare the results obtained from different imputation techniques to make sure our analysis is robust.
  7. Consider the missing data pattern: The pattern of missing data can provide valuable insights into why the data is missing and guide us in choosing the most appropriate imputation method. For example, if the data is missing completely at random, we can use any imputation method, while if the data is missing not at random, we need to be careful in our choice of imputation method.
  8. Consider the sample size: The sample size can affect the choice of imputation method. For small sample sizes, simple imputation methods such as mean imputation may be appropriate, while for larger sample sizes, more sophisticated methods such as regression imputation or multiple imputation may be needed.
  9. Validate imputation methods: Itโ€™s important to validate the imputation methods used for handling missing data. We can use validation techniques such as cross-validation or bootstrapping to assess the accuracy and reliability of our imputation methods.
  10. Communicate results effectively: Finally, itโ€™s important to communicate the results of our analysis effectively. We should clearly state the methods used for handling missing data and explain the impact of the imputation method on our results. We should also report any potential biases that may have resulted from missing data.

By following these best practices, we can handle missing data effectively, reduce the potential for bias in our results and ensure the accuracy and reliability of our analysis. At Actimize, we prioritize these best practices and continuously work to perfect them, knowing that well-built foundations are the core for thriving growth and providing robust solutions for our clients.

Summary

Missing data is a common problem in data science and can have significant impacts on the accuracy and reliability of downstream analyses. While there are various methods for handling missing data, understanding the process that generates the observed pattern of missing data is crucial for selecting appropriate methods.

By examining the correlated patterns between the DGP and missing data patterns, we can identify methods that are tailored to the specific domain and data generating process. Furthermore, by categorizing missing data patterns cross-domain and viewing missing data as sparse data, we can leverage the inherent structure of the data to handle missing values more effectively.

It is important to note that there is no one-size-fits-all approach to handling missing data. Rather, it requires a combination of domain knowledge, statistical expertise, and creativity to identify and apply the most appropriate methods for each specific scenario.

Thus, to effectively handle missing data, it is important to first understand the process that generates the observed pattern of missing data, and then select appropriate methods that are tailored to the specific domain and data generating process. By doing so, we can ensure that our downstream analyses are accurate, reliable, and informative.

About the author

Yoav Avneon, Ph.D. and Group Manager of X-Sight Data Science Research & Delivery Team at NICE Actimize. NICE Actimize is the global market leader in financial crime and compliance management, offering a comprehensive suite of Anti-Money Laundering, Fraud, and Compliance solutions. As the largest provider of financial crime, risk, and compliance solutions for regional and global financial institutions and government regulators, NICE Actimize is at the forefront of innovation in AI and ML.

--

--

YoavAvneon
YoavAvneon

Written by YoavAvneon

Experienced Group Lead Data Scientist with a passion for AI and ML with a PhD focused on Spatial Ecology. Brighu yoga practitioner. Astral traveler.