Book Image

The Applied SQL Data Analytics Workshop - Second Edition

By : Matt Goldwasser, Upom Malik, Benjamin Johnston
3.5 (2)
Book Image

The Applied SQL Data Analytics Workshop - Second Edition

3.5 (2)
By: Matt Goldwasser, Upom Malik, Benjamin Johnston

Overview of this book

Every day, businesses operate around the clock and a huge amount of data is generated at a rapid pace. Hidden in this data are key patterns and behaviors that can help you and your business understand your customers at a deep, fundamental level. Are you ready to enter the exciting world of data analytics and unlock these useful insights? Written by a team of expert data scientists who have used their data analytics skills to transform businesses of all shapes and sizes, The Applied SQL Data Analytics Workshop is a great way to get started with data analysis, showing you how to effectively sieve and process information from raw data, even without any prior experience. The book begins by showing you how to form hypotheses and generate descriptive statistics that can provide key insights into your existing data. As you progress, you'll learn how to write SQL queries to aggregate, calculate and combine SQL data from sources outside of your current dataset. You'll also discover how to work with different data types, like JSON. By exploring advanced techniques, such as geospatial analysis and text analysis, you'll finally be able to understand your business at a deeper level. Finally, the book lets you in on the secret to getting information faster and more effectively by using advanced techniques like profiling and automation. By the end of The Applied SQL Data Analytics Workshop, you'll have the skills you need to start identifying patterns and unlocking insights in your own data. You will be capable of looking and assessing data with the critical eye of a skilled data analyst.
Table of Contents (9 chapters)
7. The Scientific Method and Applied Problem Solving

Statistical Significance Testing

Another piece of analysis that is useful in data analysis is statistical significance testing. Often, an analyst is interested in comparing the statistical properties of two groups, or perhaps just one group before and after a change. Of course, the difference between these two groups may just be due to chance.

An example of where this comes up is in marketing A/B tests. Companies will often test two different types of landing pages for a product and measure the click-through rate (CTR). You may find that the CTR for variation A of the landing page is 10%, and the CTR for variation B is 11%. So, does that mean variation B is 10% better than A or is this just a result of day-to-day variance? Statistical testing helps us to determine just that.

In statistical testing, there are a couple of major parts you need to have (Figure 1.32). First, we have the test statistic we are examining. It may be a proportion, an average, the difference between two groups, or a distribution. The next necessary part is a null hypothesis, which is the idea that the results observed are the product of chance. You will then need an alternative hypothesis, which is the idea that the results seen cannot be explained by chance alone. Finally, a test requires a significance level, which is the value the test statistic needs to take before it is decided that the null hypothesis cannot explain the difference. All statistical significance tests have these four aspects, and it is simply a matter of how these components are calculated that differentiate significance tests:

Figure 1.32: Parts of statistical significance testing

Figure 1.32: Parts of statistical significance testing

Common Statistical Significance Tests

Some common statistical significance tests include the following:

  • Two-Sample Z-Test: A test for determining whether the average of the two samples is different. This test assumes that both samples are drawn from a normal distribution with a known population standard deviation.
  • Two-Sample T-test: A test for determining whether the average of two samples is different when either the sample set is too small (that is, less than 30 data points per sample) or if the population standard deviation is unknown. The two samples are also generally drawn from distributions assumed to be normal.
  • Pearson's Chi-Squared Test: A test for determining whether the distribution of data points to categories is different than what would be expected due to chance. This is the primary test for determining whether the proportions in tests, such as those in an A/B test, are beyond what would be expected from chance.


    To learn more about statistical significance, please refer to a statistics textbook, such as Statistics by David Freedman, Robert Pisani, and Roger Purves.

In the next section, we will learn the basics of relational databases and SQL. Later, we will learn about data types, commands, and queries.