3  Hypothesis Testing with z-Scores

Sample Problems

3.1 About

the one-sample z-Test problems use the RamdomData class which requires:

  • the groups variable set to 1: groups = 1
  • an intger for the sample size (e.g., n = 30)
  • a call to the z_test() method

In these sample problems, the per-group sample size is randomly set between 5 and 15. An example funciton call is included below.

sample_size = random.randint(5,15)
RandomData(groups = 1, n = sample_size).z_test()

3.2 Problem 1

Given the following data, is the mean of \(Group_A\) significantly different from the population mean: \(\mu = {22}\)?

Use a \({2}\) tailed-test with \(\alpha = {0.01}\)

A
32
29
25
21
35
33
31
31
34


The necessary summary statistics for these data
\[M_A = {30.11}\] \[{\sigma} = {4}\] \[n = {9}\]

State the Hypotheses
\[H_0: \mu = 22\] \[H_1: \mu \ne 22\]


The decision criteria:

\(z_{crit} = \pm{2.58}, \alpha_{two-tailed} = {0.01}\)

Calculate the standard error
\[\sigma_M = \frac{\sigma}{\sqrt{N}}\]
\[\sigma_M = \frac{4}{\sqrt{9}}\]
\[\sigma_M = \frac{4}{3.0}\]
\[\sigma_M = {1.33}\]

Calculate \(z_{obt}\)
\[z_{obt} = {\frac{M - \mu}{\sigma_M}}\]
\[z_{obt} = \frac{30.11 - 22}{1.33}\]
\[z_{obt} = \frac{8.11}{1.33}\]
\[z_{obt} = {6.1}\]

Calculate Cohen’s d for effect size
\[d = \frac{M - \mu}{\sigma}\]
\[d = \frac{30.11 - 22}{4}\]
\[d = \frac{8.11}{4}\]
\[d = {2.03}\]

The results:

reject the null hypothesis, results are significant,
z = 6.1, p < 0.01, d = 2.03

3.3 Problem 2

Given the following data, is the mean of \(Group_A\) significantly different from the population mean: \(\mu = {35}\)?

Use a \({2}\) tailed-test with \(\alpha = {0.05}\)

A
36
33
29
41
37
36
44
40
31
49
40
41
30
41
37


The necessary summary statistics for these data
\[M_A = {37.67}\] \[{\sigma} = {5}\] \[n = {15}\]

State the Hypotheses
\[H_0: \mu = 35\] \[H_1: \mu \ne 35\]


The decision criteria:

\(z_{crit} = \pm{1.96}, \alpha_{two-tailed} = {0.05}\)

Calculate the standard error
\[\sigma_M = \frac{\sigma}{\sqrt{N}}\]
\[\sigma_M = \frac{5}{\sqrt{15}}\]
\[\sigma_M = \frac{5}{3.87}\]
\[\sigma_M = {1.29}\]

Calculate \(z_{obt}\)
\[z_{obt} = {\frac{M - \mu}{\sigma_M}}\]
\[z_{obt} = \frac{37.67 - 35}{1.29}\]
\[z_{obt} = \frac{2.67}{1.29}\]
\[z_{obt} = {2.07}\]

Calculate Cohen’s d for effect size
\[d = \frac{M - \mu}{\sigma}\]
\[d = \frac{37.67 - 35}{5}\]
\[d = \frac{2.67}{5}\]
\[d = {0.53}\]

The results:

reject the null hypothesis, results are significant,
z = 2.07, p < 0.05, d = 0.53

3.4 Problem 3

Given the following data, is the mean of \(Group_A\) significantly different from the population mean: \(\mu = {37}\)?

Use a \({2}\) tailed-test with \(\alpha = {0.01}\)

A
26
66
27
56
46
61
49
50
53
60
45
39
47


The necessary summary statistics for these data
\[M_A = {48.08}\] \[{\sigma} = {10}\] \[n = {13}\]

State the Hypotheses
\[H_0: \mu = 37\] \[H_1: \mu \ne 37\]


The decision criteria:

\(z_{crit} = \pm{2.58}, \alpha_{two-tailed} = {0.01}\)

Calculate the standard error
\[\sigma_M = \frac{\sigma}{\sqrt{N}}\]
\[\sigma_M = \frac{10}{\sqrt{13}}\]
\[\sigma_M = \frac{10}{3.61}\]
\[\sigma_M = {2.77}\]

Calculate \(z_{obt}\)
\[z_{obt} = {\frac{M - \mu}{\sigma_M}}\]
\[z_{obt} = \frac{48.08 - 37}{2.77}\]
\[z_{obt} = \frac{11.08}{2.77}\]
\[z_{obt} = {4.0}\]

Calculate Cohen’s d for effect size
\[d = \frac{M - \mu}{\sigma}\]
\[d = \frac{48.08 - 37}{10}\]
\[d = \frac{11.08}{10}\]
\[d = {1.11}\]

The results:

reject the null hypothesis, results are significant,
z = 4.0, p < 0.01, d = 1.11

3.5 Problem 4

Given the following data, is the mean of \(Group_A\) significantly different from the population mean: \(\mu = {27}\)?

Use a \({2}\) tailed-test with \(\alpha = {0.05}\)

A
45
40
45
49
39
40
41
41


The necessary summary statistics for these data
\[M_A = {42.5}\] \[{\sigma} = {5}\] \[n = {8}\]

State the Hypotheses
\[H_0: \mu = 27\] \[H_1: \mu \ne 27\]


The decision criteria:

\(z_{crit} = \pm{1.96}, \alpha_{two-tailed} = {0.05}\)

Calculate the standard error
\[\sigma_M = \frac{\sigma}{\sqrt{N}}\]
\[\sigma_M = \frac{5}{\sqrt{8}}\]
\[\sigma_M = \frac{5}{2.83}\]
\[\sigma_M = {1.77}\]

Calculate \(z_{obt}\)
\[z_{obt} = {\frac{M - \mu}{\sigma_M}}\]
\[z_{obt} = \frac{42.5 - 27}{1.77}\]
\[z_{obt} = \frac{15.5}{1.77}\]
\[z_{obt} = {8.76}\]

Calculate Cohen’s d for effect size
\[d = \frac{M - \mu}{\sigma}\]
\[d = \frac{42.5 - 27}{5}\]
\[d = \frac{15.5}{5}\]
\[d = {3.1}\]

The results:

reject the null hypothesis, results are significant,
z = 8.76, p < 0.05, d = 3.1

3.6 Problem 5

Given the following data, is the mean of \(Group_A\) significantly different from the population mean: \(\mu = {22}\)?

Use a \({2}\) tailed-test with \(\alpha = {0.01}\)

A
30
29
30
30
31


The necessary summary statistics for these data
\[M_A = {30.0}\] \[{\sigma} = {2}\] \[n = {5}\]

State the Hypotheses
\[H_0: \mu = 22\] \[H_1: \mu \ne 22\]


The decision criteria:

\(z_{crit} = \pm{2.58}, \alpha_{two-tailed} = {0.01}\)

Calculate the standard error
\[\sigma_M = \frac{\sigma}{\sqrt{N}}\]
\[\sigma_M = \frac{2}{\sqrt{5}}\]
\[\sigma_M = \frac{2}{2.24}\]
\[\sigma_M = {0.89}\]

Calculate \(z_{obt}\)
\[z_{obt} = {\frac{M - \mu}{\sigma_M}}\]
\[z_{obt} = \frac{30.0 - 22}{0.89}\]
\[z_{obt} = \frac{8.0}{0.89}\]
\[z_{obt} = {8.99}\]

Calculate Cohen’s d for effect size
\[d = \frac{M - \mu}{\sigma}\]
\[d = \frac{30.0 - 22}{2}\]
\[d = \frac{8.0}{2}\]
\[d = {4.0}\]

The results:

reject the null hypothesis, results are significant,
z = 8.99, p < 0.01, d = 4.0