◄Previous: 5.2 Two-tailed test

# 5.3 Practical example

Now, you know how to calculate Z critical value. Let us do a z-test together.

Consider the following question:

A digital marketing agency has recently implemented a new advertising campaign aimed at increasing purchases on their e-commerce platform.

Figure 15 Advertisement influence

The marketing team has gathered data from a sample of 80 customers to assess the campaign’s effectiveness. The marketing executive asserts that the campaign has been successful, claiming that the average number of purchases per day has increased compared to the previous average. They want to test this claim with a 95% confidence level. Download the Excel file to review the data. Excel file: Digital marketing

Your task is to conduct a z-test to evaluate the marketing executive’s claim using the provided digital marketing dataset.

Let us solve this problem step by step using Excel:

Step 1: Find the Population Mean

First, we need to calculate the average of monthly purchases. In Excel:

- Go to the ‘Population’ sheet.
- Use the formula: =AVERAGE(A2:A1001) where A2:A1001 contains the population data.

The result shows the average number of purchases was 50.20. This is our population mean.

Step 2: Formulate Hypotheses

Based on the marketing executive’s claim, we can formulate our hypotheses:

- H0: The digital marketing campaign will produce equal or less than average monthly purchase results (µ ≤ 50.20).

- H1: The digital marketing campaign will produce greater than average monthly purchase results (µ > 50.20).

Note that we specify the claim we want to prove as an alternative hypothesis.

Step 3: Calculate the Z-statistic

We use the formula:

Where:

- = sample mean
- μ = population mean under the null hypothesis
- σ = population standard deviation
- n = sample size

To find these values:

1. Calculate the sample mean:

- Go to the ‘Sample’ sheet.
- Use the formula: =AVERAGE(A2:A81)

This gives us = 53.03

2. We already know µ = 50.20 from Step 1.

3. Calculate the population standard deviation:

- Go back to the ‘Population’ sheet.
- Use the formula: =STDEV.P(A2:A1001)

This gives us σ = 9.81

Important note on standard deviation functions:

Excel provides two functions for calculating standard deviation: STDEV.P() and STDEV.S().

- Use STDEV.P() when your data represents the entire population.
- Use STDEV.S() when your data is just a sample of the population.

In this case, we use STDEV.P() because we have data for the entire population of purchases.

4. We know n = 80 from the question and from our data set.

Now, let us calculate the z-statistic:

Step 4: Determine the Z Critical Value

For an upper tailed test, α = 5%, z critical value corresponds to the boundary = 95% of the z-distribution:

- In Excel, use the formula: =NORM.S.INV(0.95)

This gives us a z-critical value of 1.65.

Step 5: Make a Decision

Compare the calculated z-statistic (2.58) to the critical value (1.65). Since 2.58 > 1.65, we reject the null hypothesis. Figure 7 illustrates these results. You can see that z-statistic is outside of the fail to reject region and within the rejection region (orange area).

Figure 16 Z critical value and z-statistic.

Step 6: Interpret the Results

There is sufficient statistical evidence to support the marketing executive’s claim that the new advertising campaign has increased the average number of monthly purchases. The sample data suggests that the true population mean of monthly purchases after the campaign is significantly higher than the population average of 50.20, at a 95% confidence level.

## Activity 4: Z-test

Allow around 60 minutes for this activity.

Now, let us apply our knowledge of z-tests to a new scenario in the same marketing context.

Consider the following question:

Following their successful advertising campaign, the marketing team at the digital marketing agency has decided to explore a new strategy. They have chosen to sponsor a major football event, believing this sponsorship will further boost the number of purchases on their e-commerce platform.

After the sponsored event concluded, the marketing team collected data from a sample of 98 customers to assess the impact of this new initiative. The marketing executive is now claiming that the sponsorship has decreased the average number of purchases. Download the Excel file to review the data. Excel file: Sport sponsorship

Your task is to conduct a z-test to evaluate the marketing executive’s claim about the ineffectiveness of the football event sponsorship. You should use the same data from the previous advertising campaign example for the population mean and standard deviation.

Show your calculation in the box below.

(A text entry box would appear here, but your browser does not support it.)

### Answer

Let us solve this problem step by step using Excel:

Step 1: Find the Population Mean and Standard Deviation

We all use the same population data from the previous example:

- Population mean (µ) = 50.20
- Population standard deviation (σ) = 9.81

Step 2: Formulate Hypotheses

Based on the marketing executive’s claim, we can formulate our hypotheses:

- H₀: The sponsorship did not decrease the average number of purchases (µ ≥ 50.20).
- H₁: The sponsorship decreased the average number of purchases (µ < 50.20).

Step 3: Calculate the Z-statistic

Where:

µ = population mean under the null hypothesis (50.20)

σ = population standard deviation (9.81)

To calculate the Z-statistic, we need the sample mean () and sample size (n).

Sample Size (n):

The question states: "After the event, they gather data from a sample of 98 customers" and you can also find it from the dataset.

Therefore, n = 98

Sample Mean ():

To calculate the sample mean: use this Excel formula =AVERAGE(), in the dataset.

The result of this calculation gives us.

We use the formula:

Step 4: Determine the Z Critical Value

For a lower tailed test, α = 5%, z critical value corresponds to the boundary = 5% of the z-distribution:

- In Excel, use the formula: =NORM.S.INV(0.05)

This gives us a z-critical value of -1.645.

Step 5: Decision

We fail to reject the null hypothesis because -1.48 > -1.645. The calculated z-statistic (-1.48) does not fall in the rejection region (z < -1.645).

Figure 17 3 z critical value and z-statistic

Step 6: Interpretation

There is insufficient statistical evidence to support the marketing executive’s claim that the sponsorship decreased the number of purchases. However, it is important to note that the sample mean is lower than the population average, which aligns with the executive’s concern about the sponsorship’s effectiveness.

While we cannot conclude a statistically significant decrease in purchases, the data suggests that the sponsorship may not have had the desired positive impact.

The focus on the lower tail of the distribution is appropriate in this scenario, as we are testing for a potential decrease in purchases. This approach aligns with the marketing executive’s skepticism about the sponsorship’s success and allows us to directly evaluate the claim of ineffectiveness.

◄Contents►Next: 5.4 Finding Finding x-bar

OpenLearn - Data analysis: hypothesis testing
Except for third party materials and otherwise, this content is made available under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 Licence, full copyright detail can be found in the acknowledgements section. Please see full copyright statement for details.