Data Analysis and Statistical Programming
Introduction
John W. Tukey, the definer of the phrase exploratory data analysis (EDA), made remarkable contributions to the physical and social sciences. In the matter of data analysis, his groundbreaking contributions included the fast Fourier transform algorithm and EDA.
He reenergized descriptive statistics through EDA and changed the language and paradigm of statistics in doing so. Interestingly, it is hard, if not impossible, to find a precise definition of EDA in Tukey’s writings. This is no great surprise, because he liked to work with vague concepts, things that could be made precise in several ways. It seems that he introduced EDA by describing its characteristics and creating novel tools. His descriptions include the following: 1. “Three of the main strategies of data analysis are:
1. graphical presentation.
2. provision of flexibility in viewpoint and in facilities,
3. intensive search for parsimony and simplicity.” (Jones, 1986, Vol. IV, p. 558) 2. “In exploratory data analysis there can be no substitute for flexibility; for adapting what is calculated—and what we hope plotted—both to the needs of the situation and the clues that the data have already provided.” (p. 736) 3. “I would like to convince you that the histogram is old-fashioned. . . .” (p. 741)
. “Exploratory data analysis . . . does not need probability, significance or confidence.” (p. 794)
5. “I hope that I have shown that exploratory data analysis is actively incisive rather than passively descriptive, with real emphasis on the discovery of the unexpected.” (p. lxii) 6. “‘Exploratory data analysis’ is an attitude, a state of flexibility, a willingness to look for those things that we believe are not there, as well as those we believe to be there.” (p. 806) 7. “Exploratory data analysis isolates patterns and features of the data and reveals these forcefully to the analyst.” (Hoaglin, Mosteller, & Tukey, 1983, p. 1
) 8. “If we need a short suggestion of what exploratory data analysis is, I would suggest that: 1. it is an attitude, AND 2. a flexibility, AND 3. some graph paper (or transparencies, or both).” (Jones, 1986, Vol. IV, p. 815)
A Brief History of Data Science The term “data science” has been traced back to computer scientist Peter Naur in 1960 (Naur, 1992), but “data science” also has evolutionary seeds in statistics. In 1962, the famed statistician John W. Tukey wrote: For a long time I thought I was a statistician, interested in inferences from the particular to the general. But as I have watched mathematical statistics evolve, I have … come to feel that my central interest is in data analysis… data analysis is intrinsically an empirical science. (Tukey, 1962)
The fields of data manipulation have grown largely through methods in mathematics, statistics and computer science during this period, with research from Peter Naur, who published “Concise Survey of Computer Methods” in 1974; Gregory Piatetsky-Shapiro who organized and chaired the
first Knowledge Discovery in Databases (KDD) workshop in 1989 and Usama Fayyad, Gregory Piatetsky-Shapiro, and Padhraic Smyth, who published “From Data Mining to Knowledge Discovery in Databases” in 1996. Master Thesis reference/(2009-2011)
A reference to the term “data science” as a discipline within statistics was made in the proceedings of the Fifth Conference of the International Federation of Classification Societies in 1996. In 1997, during his inaugural lecture as the H. C. Carver Chair in Statistics at the University of Michigan, Jeff Wu actually called for statistics to be renamed “data science” and statisticians to be renamed “data scientists”. Since the beginning of the 21st century, data stockpiles have expanded exponentially, largely due to advents in processing and storage that is both efficient and economical at scale, leading to the drive to collect, analyze and display data and information in “real time”, offering an unprecedented opportunity to conduct a new form of knowledge discovery. Examples include artificial intelligence, machine learning, deep learning, scientific workflows and redefining what data actually is with the ability to study the kinds of data that are represented in the lower levels of Jennex’s revised knowledge management pyramid (e.g., voice, image and text).
With this shift has also come rethinking from scholars within the contributing disciplines, such as William S. Cleveland’s “Data Science: An Action Plan for Expanding the Technical Areas of the Field of Statistics” (2001) and Thomas H. Davenport and Jeanne Harris’s “Competing on Analytics” (2007). These authors, and others, view the emerging discipline of data science as a transformed and new field of science that has extended beyond the walls of the academy into industry all the way to the more granular level of curiosity fueled by societal connectivity
Chapter 2 : Quality Control
The definition of “quality” research in traditional (Mode 1) knowledge production has been well established for decades. This has been particularly true in the sciences. Traditionally, the process of establishing agreed upon “evidence” was a prolonged process largely controlled by universities and/ or science-based government agencies, or what is roughly termed “the Academy”. It is a term dating back to the teachings of Plato, but which is more currently defined as “a body of established opinion widely accepted as authoritative in a particular field”. Within the academy, research is conducted according to defined methods (taught by the academy), building on prior research, and utilizing the most accepted design and analytical methods.
The proposals for such research were often funded by agencies, but also foundations, and the results were often compiled and published via the peer review process in scientific journals for the academic community to discuss. The peer review process consists of journals of varying reach and impact with editorial boards of reviewers who give unbiased feedback into a paper’s merit, method and findings. These boards are also populated from members of the academy. Membership in the academy, at minimum, typically requires that one have a terminal degree from an accredited university. The process has been criticized over the years as having a number of inherent limitations, such as professional competition, disagreement on foundational beliefs, and more currently, as being subject to outside influences due to the proliferation of online and for-profit “journals” that do not subscribe to original tenets of the process or that allow for gaming of the process (Kassirer & Campion, 1994; Ferguson & Oransky, 2014).
Socially distributed science and knowledge presents a new challenge where evidence verification is not necessarily expertly derived via the peer review process but through impact and utilization measures such as code being used, libraries accessed, and verified impact of methods in real application. Papers still exist, but in open source with open comment. This, of course, gives rise to questions of the quality control of such findings and methods for which the academy was aptly designed to address. For example, what is the potential for corruption of the process; were the methods transparent and reproducible (and does it matter if the outcome is verifiable); and, what are the agreed upon standards for the process? Generations of early career academics have had to pursue a single path to recognition and/or academic tenure through the process of peer review. In this context, the process of quality control is maintained by those deemed competent by the academy to act as “peers”. The influence of these intellectual gatekeepers to traditional knowledge production cannot be overstated, including professional control through peer review to define what problems and techniques are even deemed important. Non-traditional findings or approaches to new challenges may be dismissed because they are evaluated with rubrics from the “core” rather than from the “fringe”.
Chapter 3 : Data Science and Statistics
The term “data science” has attracted a lot of attention. Much of this attention is in business (1), in government
(2), and in the academic areas of statistics
(3, 4) and computer science (5, 6). Here, we discuss data science from the perspective of scientific research. What is data science? Why might scientists care about it? Our perspective is that data science is the child of statistics and computer science. While it has inherited some of their methods and thinking, it also seeks to blend them, refocus them, and develop them to address the context and needs of modern scientific data analysis. This perspective is not new.
Over 50 years ago, Tukey (7) defined “data analysis” as a broad endeavor, much broader than traditional mathematical statistics. In a sense, today’s data science, although set against a modern backdrop, is cast from Tukey’s original mold. In modern research, scientists from diverse disciplines are confronting abundant datasets and are confident that there is value in the data for advancing their scientific goals. We give three examples at genomic, social, and galactic scales. First, modern sequencing technology has enabled high-resolution genetic sequencing at massive scale, and geneticists have connected the genetic data to large databases of individuals’ behaviors and diseases.
Modern datasets are complex. For example, consider a research problem involving climate data. There may be different types of dependencies in the data: dependencies over time, dependencies across multiple spatial scales, and dependencies among different variables, such as rainfall, pressure, and temperature. Statistics provides a rich language for parsimoniously modeling such dependencies. This language helps encode knowledge of the world into formal probability distributions, share statistical strength across related components of a problem, and capture sequential and spatial regularities among the variables. Many of these benefits are found in Bayesian statistics (8), a framework that helps articulate assumptions about data in a formal model and then prescribes the corresponding methods for analyzing data to make inferences about the world. Bayesian methods and related techniques for expressive probability modeling (9, 10) have the potential to provide the necessary tools for blending scientific domain knowledge with statistical inference from data. A related subfield of statistics concerns high-dimensional data, where we measure thousands or even millions of variables per data point. As scientific measurement has become increasingly sophisticated, statistical inference from high-dimensional data has become more important to many scientific disciplines. To handle such data, statisticians and computer scientists have developed powerful methods involving robustness, regularization, and stability
(11). Furthermore, high-dimensional data often arise in pattern recognition problems, where we make a prediction about an unknown variable based on a large set of related variables or parameters. Machine learning techniques
(12), such as deep learning
(13), have been particularly effective in this context. They provide flexible ways that the target variable can depend on the predictors, and they can now scale up to very large datasets. The implicit promise of rich datasets is that they can help deepen our understanding of how the world works, and using data to attain such understanding is the lofty goal of causal inference. Statistical thinking about causality stretches back to the late 1800s, with the development of influential ideas around the difference between correlation and causation and how to design meaningful experiments. Today, causality has grown into a rich field (14–16), with significant contributions from computer science, the social sciences, and statistics. Developing new methods in causal inference—how to scale up to large datasets, how to develop inferences from observational data, how to develop inferences from interacting data (as in a social network), and how to design experiments in the computer age—is a ripe avenue for statistical contributions to data science.
Chapter 4:: Computational Thinking
Computational Perspective Statistical thinking provides methods to answer scientific questions with data. Computational thinking focuses on the algorithmic implementation of those methods, and it provides a way to understand and compare their computational footprints. Computational thinking is particularly important in modern data analysis, where we frequently face a tradeoff between statistical accuracy and computational resources, such as time and memory. One well-known example of computational thinking revolves around optimization
(17). Many data science methods involve maximizing a function of the data. (A primary example of this is when we try to maximize the likelihood of the data with respect to parameters of a probability model.) The most common way to maximize a function is to climb it, iteratively computing the direction to travel and moving its free parameters along that direction. In the context of optimization, computational thinking involves understanding how to best compute the direction, when approximate directions suffice, how far to walk at each iteration, and how much accuracy we sacrifice when we stop climbing early to save computation.
Computational thinking refers to the thought processes involved in expressing solutions as computational steps or algorithms that can be carried out by a computer. (Cuny, Snyder, & Wing, 2010; Aho, 2011; Lee, 2016).
Operational Definition of Computational Thinking Computational thinking (CT) is a problem-solving process that includes (but is not limited to) the following characteristics: Formulating problems in a way that enables us to use a computer and other tools to help solve them.
Logically organizing and analyzing data
Representing data through abstractions such as models and simulations
Automating solutions through algorithmic thinking (a series of ordered steps) Identifying, analyzing, and implementing possible solutions with the goal of achieving the most efficient and effective combination of steps and resources Generalizing and transferring this problem solving process to a wide variety of problems
Examples of Decomposition in Curriculum
English Language Arts: Students analyze themes in a text by first answering: Who is the protagonist and antagonist? Where is the setting? What is the conflict? What is the resolution?
Mathematics: Students find the area of different shapes by decomposing them into triangles. Science: Students research the different organs in order to understand how the human body digests food.
Social Studies: Students explore a different culture by studying the traditions, history, and norms that comprise it. Languages: Students learn about sentence structure in a foreign language by breaking it down into different parts like subject, verb, and object.
Arts: Students work to build the set for a play by reviewing the scenes to determine their setting and prop needs.
Bayesian inference is the process of fitting a probability model to a set of data and summarizing the result by a probability distribution on the parameters of the model and on unobserved quantities such as predictions for new observations
The essential characteristic of Bayesian methods is their explicit use of probability for quantifying uncertainty in inferences based on statistical data analysis. The process of Bayesian data analysis can be idealized by dividing it into the following three steps:
1. Setting up a full probability model—a joint probability distribution for all observable and unobservable quantities in a problem. The model should be consistent with knowledge about the underlying scientific problem and the data collection process.
2. Conditioning on observed data: calculating and interpreting the appropriate posterior distribution—the conditional probability distribution of the unobserved quantities of ultimate interest, given the observed data.
3. Evaluating the fit of the model and the implications of the resulting posterior distribution: how well does the model fit the data, are the substantive conclusions reasonable, and how sensitive are the results to the modeling assumptions in step 1? In response, one can alter or expand the model and repeat the three steps.
We have already used concepts such as probability density, and indeed we assume that the reader has a fair degree of familiarity with basic probability theory (although in Section 1.8 we provide a brief technical review of some probability calculations that often arise in Bayesian analysis).
Chapter 5: Bayesian Framework
But since the uses of probability within a Bayesian framework are much broader than within non-Bayesian statistics, it is important to consider at least briefly the foundations of the concept of probability before considering more detailed statistical examples. We take for granted a common understanding on the part of the reader of the mathematical definition of probability: that probabilities are numerical quantities, defined on a set of ‘outcomes,’ that are nonnegative, additive over mutually exclusive outcomes, and sum to 1 over all possible mutually exclusive outcomes.
In Bayesian statistics, probability is used as the fundamental measure or yardstick of uncertainty. Within this paradigm, it is equally legitimate to discuss the probability of ‘rain tomorrow’ or of a Brazilian victory in the soccer World Cup as it is to discuss the probability that a coin toss will land heads. Hence, it becomes as natural to consider the probability that an unknown estimand lies in a particular range of values as it is to consider the probability that the mean of a random sample of 10 items from a known fixed population of size 100 will lie in a certain range. The first of these two probabilities is of more interest after data have been acquired whereas the second is more relevant beforehand. Bayesian methods enable statements to be made about the partial knowledge available (based on data) concerning some situation or ‘state of nature’ (unobservable or as yet unobserved) in
12 1. PROBABILITY AND INFERENCE a systematic way, using probability as the yardstick. The guiding principle is that the state of knowledge about anything unknown is described by a probability distribution.
What is meant by a numerical measure of uncertainty? For example, the probability of ‘heads’ in a coin toss is widely agreed to be 1
2 . Why is this so? Two justifications seem to be commonly given:
1. Symmetry or exchangeability argument: probability = number of favorable cases number of possibilities , assuming equally likely possibilities. For a coin toss this is really a physical argument, based on assumptions about the forces at work in determining the manner in which the coin will fall, as well as the initial physical conditions of the toss.
2. Frequency argument: probability = relative frequency obtained in a long sequence of tosses, assumed to be performed in an identical manner, physically independently of each other. Both the above arguments are in a sense subjective, in that they require judgments about the nature of the coin and the tossing procedure, and both involve semantic arguments about the meaning of equally likely events, identical measurements, and independence. The frequency argument may be perceived to have certain special difficulties, in that it involves the hypothetical notion of a long sequence of identical tosses. If taken strictly, this point of view does not allow a statement of probability for a single coin toss that does not happen to be embedded, at least conceptually, in a long sequence of identical events
What is meant by a numerical measure of uncertainty? For example, the probability of ‘heads’ in a coin toss is widely agreed to be
1 2 . Why is this so? Two justifications seem to be commonly given:
1. Symmetry or exchangeability argument: probability = number of favorable cases number of possibilities , assuming equally likely possibilities. For a coin toss this is really a physical argument, based on assumptions about the forces at work in determining the manner in which the coin will fall, as well as the initial physical conditions of the toss.
2. Frequency argument: probability = relative frequency obtained in a long sequence of tosses, assumed to be performed in an identical manner, physically independently of each other. Both the above arguments are in a sense subjective, in that they require judgments about the nature of the coin and the tossing procedure, and both involve semantic arguments about the meaning of equally likely events, identical measurements, and independence. The frequency argument may be perceived to have certain special difficulties, in that it involves the hypothetical notion of a long sequence of identical tosses. If taken strictly, this point of view does not allow a statement of probability for a single coin toss that does not happen to be embedded, at least conceptually, in a long sequence of identical events
All statistical methods that use probability are subjective in the sense of relying on mathematical idealizations of the world. Bayesian methods are sometimes said to be especially subjective because of their reliance on a prior distribution, but in most problems, scientific judgment is necessary to specify both the ‘likelihood’ and the ‘prior’ parts of the model. For example, linear regression models are generally at least as suspect as any prior distribution that might be assumed about the regression parameters. A general principle is at work here: whenever there is replication, in the sense of many exchangeable units observed, there is scope for estimating features of a probability distribution from data and thus making the analysis more ‘objective.’ If an experiment as a whole is replicated several times, then the parameters of the prior distribution can themselves be estimated from data,
In any case, however, certain elements requiring scientific judgment will remain, notably the choice of data included in the analysis, the parametric forms assumed for the distributions, and the ways in which the model is checked.
Modern Bayesian statistics is mostly performed using computer code.
This has dramatically changed how Bayesian statistics was performed from even a few decades ago. The complexity of models build has increased, and the barrier of necessary mathematical and computational skills has been lowered. Additionally, the iterative modeling process has become, in many aspects, much easier to perform and more relevant than ever. The popularization of very powerful computer methods is really great but also demands an increased level of responsibility. Even if expressing statistical methods is easier than ever, statistics is a field full of subtleties that do not magically disappear by using powerful computational methods.
Statistical software has a key role in data analysis in the current era of data-driven research. The various statistical methods that cannot be used due to mathematical complications can be performed through software such as Bayesian analysis. This analysis became popular after the development of statistical software. The commonly used statistical software SPSS and STATA have some facilities for Bayesian Analysis. In Bayesian analysis, the population parameter itself is a random quantity following certain probability distribution. This prior distribution merges with the current data and becomes a posterior distribution of parameters, which is used for statistical inference. Bayesian analysis follows the same pattern in SPSS and STATA, and with similar prior, the posterior distribution is the same in both softwares. In comparison, STATA has more range of statistical analysis as compared to SPSS, but SPSS is easier to use. The STATA is recommended for statisticians, while SPSS is more useful for Bayesian researchers who are not experts in this field.
After 1990, the Bayesian analysis become more popular due to the advancement of personal computers. The computational facilities provided through computers reduce the burden of mathematical calculations. Even a nonstatistical person can easily use the Bayesian analysis in their own research or data analysis. The era of 1990–2010 was the development of Bayesian techniques through computer-generated programming like C and FORTRAN. Along with this programming language, some mid-term languages also developed, like R[1,2] and Win bugs[1,3] which have become more popular as compared to old languages. After the popularity of Bayesian analysis in statistical fraternity, applied researchers also intended to learn such new and beneficial techniques of data analysis. The applied researcher was very familiar with software like SPSS and STATA, which are the user interface statistical analysis softwares; for such researchers, the analysis of data through Bayesian techniques was performed in R or Win bugs, which was tough to learn and handle without the help of any statistician.
SAS provides two avenues for Bayesian analysis: built-in Bayesian analysis in certain modeling procedures and the MCMC procedure for general-purpose modeling. The built-in Bayesian procedures are ideal for data analysts beginning to use Bayesian methods, and they suffice for many analysis objectives. Simply adding the BAYES statement generates Bayesian analyses without the need to program priors and likelihoods for the GENMOD, PHREG, LIFEREG, and FMM procedures.
Thus, you can obtain Bayesian results for the following:
• linear regression
• Poisson regression
• logistic regression
• loglinear models
• accelerated failure time models
• Cox proportional models
• piecewise exponential models
• frailty models
• finite mixture models
Chapter 6 : Bayesian Statistics inside IBM SPSS
In the IBM SPSS Statistics, the Bayesian procedures are as easy to run as our classical standard statistical tests. You can run Linear Regression, ANOVA, One-Sample, Pair-Sample, Independent-Sample T-tests, Binomial Proportion Inference, Poisson Distribution Analysis, Pairwise Pearson Correlation, and Loglinear models to test the independence of two categorical variables.
In 2018, an advanced Bayesian procedure was released along with the IBM Statistics Subscription to run the One-way Repeated Measures ANOVA model, which is used to provide the measures on the mean of the responses over multiple time points or conditions for the subjects.
In this session, an example is provided to show how the Bayesian one-way repeated measures ANOVA works in the IBM Statistics Subscription to solve the issues.
User Story
A consultancy received a request from a high school principle. The principle wanted the consultancy to help him choose one of four memory approaches that produces the best student performance. He wants the chosen approach to be used throughout the school. Jack, the experienced senior consultant was assigned to this task. He decided to use the experiments to get the data and analyze the data to draw some conclusions.
He recruited 20 volunteers, asked them to use each of the four memory approaches, and recorded their test scores for each approach. The test scores were used to measure the performances of the approaches. The assumptions were that the higher the score, the better the performance and the same score, the same performance. Finally, a set of data was obtained.
According to the data, Jack wanted to know the following information:
- Whether the performances of the four approaches were the same?
- Which approach might have the best performance to be recommended to the principle?
Based on Jack’s previous experience, he thought the data should follow the normal distribution.
Listed below is the test score data:
| Participants | TScore1 | TScore2 | TScore3 | TScore4 |
| 1 | 8 | 7 | 6 | 7 |
| 2 | 5 | 8 | 5 | 6 |
| 3 | 6 | 5 | 3 | 4 |
| 4 | 6 | 6 | 7 | 3 |
| 5 | 8 | 10 | 8 | 6 |
| 6 | 6 | 5 | 6 | 3 |
| 7 | 6 | 5 | 2 | 3 |
| 8 | 9 | 9 | 9 | 6 |
| 9 | 5 | 4 | 3 | 7 |
| 10 | 7 | 6 | 6 | 5 |
| 11 | 8 | 7 | 6 | 7 |
| 12 | 5 | 8 | 5 | 6 |
| 13 | 6 | 5 | 3 | 4 |
| 14 | 6 | 6 | 7 | 3 |
| 15 | 9 | 10 | 8 | 6 |
| 16 | 6 | 5 | 6 | 3 |
| 17 | 6 | 5 | 2 | 3 |
| 18 | 9 | 9 | 9 | 6 |
| 19 | 5 | 4 | 3 | 7 |
| 20 | 7 | 6 | 6 | 5 |
We can see that there are five variables in the data, the first one is the participant ID, and the next four variables are the test scores after using the memory approach 1, 2, 3 and 4, named TScore1, TScore2, TScore3, and TScore4. There were 20 candidates who attended the test and got the test score.
Let’s do some analysis on the two questions then. Since the average (mean) of scores reflect the overall performance level, we compare the performances of four approaches based on the average (mean). According to the assumption above, the higher mean indicates that the approach has the better performance, the same mean indicates that the approaches have the same performances. So the highest mean should have the best performance. Then, we can measure the performance by testing the mean, and translate the two questions into the following:
- Whether the four approaches have the similar means?
- Which approach has the highest mean?
Also, from the data, we can see that for the same participant, the four memory approaches are all measured on him or her. In the field of statistics, the participant is considered the subject, and the four approaches are measured on the same subject. Per the concept of the repeated measures, all the measures on the same subject are considered as the repeated measures. So the four approaches can be considered as the repeated measures. The first question above can then be changed to:
- Whether the four repeated measures have the similar means?
The repeated measures ANOVA can test if two or more variables have similar means, and both the Classical and Bayesian have the procedures to test the equality of multiple group means. Considering we have the prior distribution of data. We select the Bayesian one-way repeated measures ANOVA to solve the questions.
IBM SPSS Statistics Bayesian One-Way Repeated Measures ANOVA Procedure
We can use the Bayes Factor to test whether the four approaches have similar means in this procedure. It can get a confirmed result based on the value of the Bayes Factor. Then, we can estimate and plot the posterior distribution of each group mean, the basic characteristic of the Bayesian to tell which one might have the highest mean.
The data above has already been entered in the IBM SPSS Statistics Subscription below:
Conclusion :
For many businesses, research institutions, data scientists, data analyst experts and statisticians, SPSS Statistics is the standard for statistical analysis.
SPSS Statistics can empower its users with the following capabilities:
- Understanding data through comprehensive analysis and visualization
- Analyzing trends using regression and other statistical methods to spot pattern
- Predicting future scenarios with reliable forecasts using techniques like time-series analysis
- Validating assumptions through robust statistical modeling and tailored statistical tests
- Driving accurate conclusions that guide strategic business initiatives
IBM SPSS Statistics provides an intuitive user interface and low-code approach that help to quickly access, manage and analyze a wide range of datasets. It is a robust and powerful statistical software designed to help make data-driven decisions across different fields such as social science, policy-making, healthcare research and more.
With data visualization capabilities, advanced statistical analysis methods and modeling techniques, IBM SPSS Statistics enables users to pursue a comprehensive analytical journey from data preparation and management to analysis and reporting. By providing advanced visualization and reporting tools, SPSS Statistics allows data practitioners to run a wide variety of statistical tests and analyses and create high-resolution graphs and presentation-ready reports to easily communicate results.
A workflow is a strategy to keep track of, enter, clean, describe, and transform data. These data may have been collected through surveys or may be secondary data. Haphazardly entering, cleaning, and analyzing bits of data is not a good strategy, since it increases one’s likelihood of making mistakes and makes it hard to replicate results. Moreover, without a good workflow of data, it becomes hard to document the research process and cooperate on projects.