0% found this document useful (0 votes)
71 views

One-Sample Z-Tests: Other PASS Procedures For Testing One Mean or Median

Uploaded by

Rafi Ullah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
71 views

One-Sample Z-Tests: Other PASS Procedures For Testing One Mean or Median

Uploaded by

Rafi Ullah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

PASS Sample Size Software NCSS.

com

Chapter 414

One-Sample Z-Tests
Introduction
The one-sample z-test is used to test whether the mean of a population is greater than, less than, or not equal to a
specific value. Because the standard normal distribution is used to calculate critical values for the test, this test is
often called the one-sample z-test. The z-test assumes that the population standard deviation is known.

Other PASS Procedures for Testing One Mean or Median


Procedures in PASS are primarily built upon the testing methods, test statistic, and test assumptions that will be
used when the analysis of the data is performed. You should check to identify that the test procedure described
below in the Test Procedure section matches your intended procedure. If your assumptions or testing method are
different, you may wish to use one of the other one-sample procedures available in PASS–the One-Sample T-
Tests and the nonparametric Wilcoxon Signed-Rank Test procedures. The methods, statistics, and assumptions for
those procedures are described in the associated chapters.
If you wish to show that the mean of a population is larger (or smaller) than a reference value by a specified
amount, you should use one of the clinical superiority procedures for comparing means. Non-inferiority,
equivalence, and confidence interval procedures are also available.

The Statistical Hypotheses


In the usual z-test setting, the null (𝐻𝐻0 ) and alternative (𝐻𝐻1 ) hypotheses for two-sided tests are defined as
𝐻𝐻0 : 𝜇𝜇 = 𝜇𝜇0 versus 𝐻𝐻1 : 𝜇𝜇 ≠ 𝜇𝜇0
Rejecting 𝐻𝐻0 implies that the mean is not equal to the value 𝜇𝜇0 . The hypotheses for one-sided upper-tail tests are
𝐻𝐻0 : 𝜇𝜇 ≤ 𝜇𝜇0 versus 𝐻𝐻1 : 𝜇𝜇 > 𝜇𝜇0
Rejecting 𝐻𝐻0 implies that the mean is larger than the value 𝜇𝜇0 . This test is called an upper-tail test because 𝐻𝐻0 is
rejected in samples in which the sample mean is larger than 𝜇𝜇0 .
The lower-tail test is
𝐻𝐻0 : 𝜇𝜇 ≥ 𝜇𝜇0 versus 𝐻𝐻1 : 𝜇𝜇 < 𝜇𝜇0

414-1
© NCSS, LLC. All Rights Reserved.
PASS Sample Size Software NCSS.com
One-Sample Z-Tests

It will be convenient to adopt the following specialize notation for the discussion of these tests.

Parameter PASS Input/Output Interpretation


𝜇𝜇 𝜇𝜇 Population mean. If the data are paired differences, this is the mean of
those differences. This parameter will be estimated by the study.
𝜇𝜇1 𝜇𝜇1 Actual population mean at which power is calculated. This is the
assumed population mean used in all calculations.
𝜇𝜇0 𝜇𝜇0 Reference value. Usually, this is the mean of a reference population. If
the data are paired differences, this is the hypothesized value of the mean
difference.
𝛿𝛿 𝛿𝛿 Population difference. This is the value of 𝜇𝜇 − 𝜇𝜇0 , the difference
between the population mean and the reference value. This parameter
will be estimated by the study.
𝛿𝛿1 𝛿𝛿1 Actual difference at which power is calculated. This is the value of
𝜇𝜇1 − 𝜇𝜇0 , the assumed difference between the mean and the reference
value for power calculations.

Assumptions for One-Sample Tests


This section describes the assumptions that are made when you use one of the one-sample tests. The key
assumption relates to normality or non-normality of the data. One of the reasons for the popularity of the t-test is
its robustness in the face of assumption violation. However, if an assumption is not met even approximately, the
significance levels and the power of the t-test are invalidated. Unfortunately, in practice it often happens that
several assumptions are not met. This makes matters even worse! Hence, take the steps to check the assumptions
before you make important decisions based on these tests.

One-Sample Z-Test Assumptions


The assumptions of the one-sample z-test are:
1. The data are continuous (not discrete).
2. The data follow the normal probability distribution.
3. The sample is a simple random sample from its population. Each individual in the population has an equal
probability of being selected in the sample.
4. The population standard deviation is known.

One-Sample T-Test Assumptions


The assumptions of the one-sample t-test are:
1. The data are continuous (not discrete).
2. The data follow the normal probability distribution.
3. The sample is a simple random sample from its population. Each individual in the population has an equal
probability of being selected in the sample.

414-2
© NCSS, LLC. All Rights Reserved.
PASS Sample Size Software NCSS.com
One-Sample Z-Tests

Paired T-Test Assumptions


The assumptions of the paired t-test are:
1. The data are continuous (not discrete).
2. The data, i.e., the differences for the matched-pairs, follow a normal probability distribution.
3. The sample of pairs is a simple random sample from its population. Each individual in the population has
an equal probability of being selected in the sample.

Wilcoxon Signed-Rank Test Assumptions


The assumptions of the Wilcoxon signed-rank test are as follows (note that the difference is between a data value
and the hypothesized median or between the two data values of a pair):
1. The differences are continuous (not discrete).
2. The distribution of each difference is symmetric.
3. The differences are mutually independent.
4. The differences all have the same median.
5. The measurement scale is at least interval.

Limitations
There are few limitations when using these tests. Sample sizes may range from a few to several hundred. If your
data are discrete with at least five unique values, you can often ignore the continuous variable assumption.
Perhaps the greatest restriction is that your data come from a random sample of the population. If you do not have
a random sample, your significance levels will probably be incorrect.

One-Sample Z-Test Statistic


The one-sample z-test assumes that the data are a simple random sample from a population of normally-
distributed values that all have the same mean and variance (known). This assumption implies that the data are
continuous and their distribution is symmetric. The calculation of the z-test proceeds as follows
𝑋𝑋� − 𝐴𝐴
𝑧𝑧 =
𝜎𝜎⁄√𝑛𝑛
where
∑𝑛𝑛𝑖𝑖=1 𝑋𝑋𝑖𝑖
𝑋𝑋� =
𝑛𝑛
and 𝐴𝐴 is the value of the mean hypothesized by the null hypothesis that incorporates both 𝜇𝜇0 and 𝑀𝑀𝑁𝑁𝑁𝑁 .
The significance of the test statistic is determined by computing the p-value. If this p-value is less than a specified
level (usually 0.05), the hypothesis is rejected. Otherwise, no conclusion can be reached.

414-3
© NCSS, LLC. All Rights Reserved.
PASS Sample Size Software NCSS.com
One-Sample Z-Tests

Power Calculation for the One-Sample Z-Test


When the standard deviation is known, the power is calculated as follows for a directional alternative (one-tailed
test) in which 𝜇𝜇1 > 𝜇𝜇0 .
1. Find 𝑧𝑧𝛼𝛼 such that 1 − Φ(𝑧𝑧𝛼𝛼 ) = 𝛼𝛼, where Φ(𝑥𝑥) is the area to the left of x under the standardized normal
curve.
𝜎𝜎
2. Calculate: 𝑋𝑋1 = 𝜇𝜇0 + 𝑧𝑧𝛼𝛼 .
√𝑛𝑛
𝑋𝑋1 −𝜇𝜇1
3. Calculate: 𝑧𝑧1 = 𝜎𝜎 .
√𝑛𝑛

4. Power = 1 − Φ(𝑧𝑧1 ).

Procedure Options
This section describes the options that are specific to this procedure. These are located on the Design tab. For
more information about the options of other tabs, go to the Procedure Window chapter.

Design Tab
The Design tab contains most of the parameters and options that you will be concerned with.

Solve For
Solve For
This option specifies the parameter to be calculated from the values of the other parameters. Under most
conditions, you would select either Power or Sample Size.
Select Sample Size when you want to determine the sample size needed to achieve a given power and alpha error
level.
Select Power when you want to calculate the power of an experiment that has already been run.

Test
Alternative Hypothesis
Specify the alternative hypothesis of the test. Since the null hypothesis is the opposite of the alternative,
specifying the alternative is all that is needed. Usually, the two-tailed (≠) option is selected.
The options containing only < or > are one-tailed tests. When you choose one of these options, you must be sure
that the input parameters match this selection.
Possible selections are:

• Two-Sided (H1: μ ≠ μ0)


This is the most common selection. It yields the two-tailed z-test. Use this option when you are testing
whether the means are different but you do not want to specify beforehand which mean is larger. Many
scientific journals require two-tailed tests.

• One-Sided (H1: μ < μ0)


This option yields a one-tailed z-test. Use it when you are only interested in the case in which μ is less than
μ0.

414-4
© NCSS, LLC. All Rights Reserved.
PASS Sample Size Software NCSS.com
One-Sample Z-Tests

• One-Sided (H1: μ > μ0)


This option yields a one-tailed z-test. Use it when you are only interested in the case in which μ is greater than
μ0.
Population Size
This is the number of subjects in the population. Usually, you assume that samples are drawn from a very large
(infinite) population. Occasionally, however, situations arise in which the population of interest is of limited size.
In these cases, appropriate adjustments must be made.
When a finite population size is specified, the standard deviation is reduced according to the formula:
𝑛𝑛
𝜎𝜎12 = �1 − � 𝜎𝜎 2
𝑁𝑁
where n is the sample size, N is the population size, 𝜎𝜎 is the original standard deviation, and 𝜎𝜎1 is the new
standard deviation.
𝑛𝑛
The quantity n/N is often called the sampling fraction. The quantity �1 − � is called the finite population
𝑁𝑁
correction factor.

Power and Alpha


Power
This option specifies one or more values for power. Power is the probability of rejecting a false null hypothesis,
and is equal to one minus Beta. Beta is the probability of a type-II error, which occurs when a false null
hypothesis is not rejected.
Values must be between zero and one. Historically, the value of 0.80 (Beta = 0.20) was used for power. Now,
0.90 (Beta = 0.10) is also commonly used.
A single value may be entered here or a range of values such as 0.8 to 0.95 by 0.05 may be entered.
Alpha
This option specifies one or more values for the probability of a type-I error. A type-I error occurs when a true
null hypothesis is rejected.
Values must be between zero and one. Historically, the value of 0.05 has been used for alpha. This means that
about one test in twenty will falsely reject the null hypothesis. You should pick a value for alpha that represents
the risk of a type-I error you are willing to take in your experimental situation.
You may enter a range of values such as 0.01 0.05 0.10 or 0.01 to 0.10 by 0.01.

Sample Size
N (Sample Size)
This option specifies one or more values of the sample size, the number of individuals in the study. This value
must be an integer greater than one. Note that you may enter a list of values using the syntax 50,100,150,200,250
or 50 to 250 by 50.

414-5
© NCSS, LLC. All Rights Reserved.
PASS Sample Size Software NCSS.com
One-Sample Z-Tests

Effect Size – Means


μ0 (Null or Baseline Mean)
Enter a value for the population mean under the null hypothesis. This is the reference or baseline mean.
Only the difference between μ1 and μ0 is used in the calculations.
μ1 (Actual Mean)
Enter a value (or range of values) for the actual population mean at which power and sample size are calculated.
Only the difference between μ1 and μ0 is used in the calculations.

Effect Size – Standard Deviation


σ (Standard Deviation)
This option specifies one or more values of the known standard deviation. This must be a positive value.
PASS includes a special module for estimating the standard deviation. This module may be loaded by pressing
the SD button. Refer to the Standard Deviation Estimator chapter for further details.

414-6
© NCSS, LLC. All Rights Reserved.
PASS Sample Size Software NCSS.com
One-Sample Z-Tests

Example 1 – Power after a Study


This example will cover the situation in which you are calculating the power of a z-test on data that have already
been collected and analyzed. For example, you might be playing the role of a reviewer, looking at the power of a
z-test from a study you are reviewing. In this case, you would not vary the means or sample size since they are
given by the experiment. Instead, you investigate the power of the significance tests. You might look at the impact
of different alpha values on the power.
Suppose an experiment involving 100 individuals yields the following summary statistics:
Hypothesized mean (μ0) 100.0
Sample mean (μ1) 110.0
Sample size 100
Given the above data, analyze the power of a z-test which tests the hypothesis that the population mean is 100
versus the alternative hypothesis that the population mean is 110. Consider the power at significance levels 0.01,
0.05, 0.10 and sample sizes 20 to 120 by 20. The standard deviation is known to be 40.
Note that we have set μ1 equal to the sample mean. In this case, we are studying the power of the z-test for a mean
difference the size of that found in the experimental data.

Setup
This section presents the values of each of the parameters needed to run this example. First, from the PASS Home
window, load the One-Sample Z-Tests procedure window by expanding Means, then One Mean, then clicking
on Z-Test (Inequality), and then clicking on One-Sample Z-Tests. You may then make the appropriate entries
as listed below, or open Example 1 by going to the File menu and choosing Open Example Template.
Option Value
Design Tab
Solve For ................................................ Power
Alternative Hypothesis ............................ Two-Sided (H1: μ ≠ μ0)
Population Size ....................................... Infinite
Alpha ....................................................... 0.01 0.05 0.10
N (Sample Size)...................................... 20 to 120 by 20
μ0 (Null or Baseline Mean) ..................... 100
μ1 (Actual mean) .................................... 110
σ (Standard Deviation) ........................... 40

414-7
© NCSS, LLC. All Rights Reserved.
PASS Sample Size Software NCSS.com
One-Sample Z-Tests

Annotated Output
Click the Calculate button to perform the calculations and generate the following output.

Numeric Results ────────────────────────────────────────────────────────────


Hypotheses: H0: μ = μ0 vs. H1: μ ≠ μ0

Diff Effect
Power N μ0 μ1 μ1 - μ0 σ Size Alpha Beta
0.07256 20 100.0 110.0 10.0 40.0 0.250 0.010 0.92744
0.15996 40 100.0 110.0 10.0 40.0 0.250 0.010 0.84004
0.26130 60 100.0 110.0 10.0 40.0 0.250 0.010 0.73870
0.36702 80 100.0 110.0 10.0 40.0 0.250 0.010 0.63298
0.46978 100 100.0 110.0 10.0 40.0 0.250 0.010 0.53022
0.56466 120 100.0 110.0 10.0 40.0 0.250 0.010 0.43534
(report continues)

Report Definitions
Power is the probability of rejecting a false null hypothesis. It should be close to one.
N is the size of the sample drawn from the population. To conserve resources, it should be small.
μ0 is the value of the population mean under the null hypothesis.
μ1 is the actual value of the population mean at which power and sample size are calculated.
μ1 - μ0 is the difference between the actual and null means.
σ is the standard deviation of the population. It measures the variability in the population.
Effect Size = |μ1 - μ0|/σ is the relative magnitude of the effect.
Alpha is the probability of rejecting a true null hypothesis. It should be small.
Beta is the probability of accepting a false null hypothesis. It should be small.

Summary Statements ─────────────────────────────────────────────────────────


A sample size of 20 achieves 7% power to detect a difference of 10.0 between the actual mean of
110.0 and the null hypothesized mean of 100.0 with a known standard deviation of 40.0 and with
a significance level (alpha) of 0.010 using a two-sided one-sample z-test.

This report shows the values of each of the parameters, one scenario per row. The values of power and beta were
calculated from the other parameters.
The definitions of each column are given in the Report Definitions section.

Plots Section

These plots show the relationship between sample size and power for various values of alpha.

414-8
© NCSS, LLC. All Rights Reserved.
PASS Sample Size Software NCSS.com
One-Sample Z-Tests

Example 2 – Finding the Sample Size


This example will consider the situation in which you are planning a study that will use the one-sample z-test and
want to determine an appropriate sample size. This example is more subjective than the first because you now
have to obtain estimates of all the parameters. In the first example, these estimates were provided by the data.
In studying deaths from SIDS (Sudden Infant Death Syndrome), one hypothesis put forward is that infants dying
of SIDS weigh less than normal at birth. Suppose the average birth weight of infants is 3300 grams with a known
standard deviation of 663 grams. Use an alpha of 0.05 and power of both 0.80 and 0.90. How large a sample of
SIDS infants will be needed to detect a drop in average weight of 25%? Of 10%? Of 5%? Note that applying these
percentages to the average weight of 3300 yields 2475, 2970, and 3135.
Although a one-sided hypothesis is being considered, sample size estimates will assume a two-sided alternative to
keep the research design in line with other studies.

Setup
This section presents the values of each of the parameters needed to run this example. First, from the PASS Home
window, load the One-Sample Z-Tests procedure window by expanding Means, then One Mean, then clicking
on Z-Test (Inequality), and then clicking on One-Sample Z-Tests. You may then make the appropriate entries
as listed below, or open Example 2 by going to the File menu and choosing Open Example Template.
Option Value
Design Tab
Solve For ................................................ Sample Size
Alternative Hypothesis ............................ Two-Sided (H1: μ ≠ μ0)
Population Size ....................................... Infinite
Power ...................................................... 0.80 0.90
Alpha ....................................................... 0.05
μ0 (Null or Baseline Mean) ..................... 3300
μ1 (Actual mean) .................................... 2475 2970 3135
σ (Standard Deviation) ........................... 663

Output
Click the Calculate button to perform the calculations and generate the following output.

Numeric Results ────────────────────────────────────────────────────────────


Hypotheses: H0: μ = μ0 vs. H1: μ ≠ μ0

Diff Effect
Power N μ0 μ1 μ1 - μ0 σ Size Alpha Beta
0.86171 6 3300.0 2475.0 -825.0 663.0 1.244 0.050 0.13829
0.90861 7 3300.0 2475.0 -825.0 663.0 1.244 0.050 0.09139
0.80391 32 3300.0 2970.0 -330.0 663.0 0.498 0.050 0.19609
0.90387 43 3300.0 2970.0 -330.0 663.0 0.498 0.050 0.09613
0.80085 127 3300.0 3135.0 -165.0 663.0 0.249 0.050 0.19915
0.90058 170 3300.0 3135.0 -165.0 663.0 0.249 0.050 0.09942

This report shows the values of each of the parameters, one scenario per row. Since there were three values of μ1
and two values of power, there are a total of six rows in the report.
We were solving for the sample size, N. Notice that the increase in sample size seems to be most directly related
to the difference between the two means. The difference in beta values does not seem to be as influential,
especially at the smaller sample sizes.

414-9
© NCSS, LLC. All Rights Reserved.
PASS Sample Size Software NCSS.com
One-Sample Z-Tests

Note that even though we set the power values at 0.8 and 0.9, these are not the power values that were achieved.
This happens because N can only take on integer values. The program selects the first value of N that gives at
least the values of alpha and power that were desired.

Example 3 – Finding the Minimum Detectable Difference


This example will consider the situation in which you want to determine how small of a difference between the
two means can be detected by the z-test with specified values of the other parameters.
Continuing with the previous example, suppose about 50 SIDS deaths occur in a particular area per year. Using
50 as the sample size, 0.05 as alpha, and 0.80 as power, how large of a difference between the means is
detectable?

Setup
This section presents the values of each of the parameters needed to run this example. First, from the PASS Home
window, load the One-Sample Z-Tests procedure window by expanding Means, then One Mean, then clicking
on Z-Test (Inequality), and then clicking on One-Sample Z-Tests. You may then make the appropriate entries
as listed below, or open Example 3 by going to the File menu and choosing Open Example Template.
Option Value
Design Tab
Solve For ................................................ μ1 (Search < μ0)
Alternative Hypothesis ............................ Two-Sided (H1: μ ≠ μ0)
Population Size ....................................... Infinite
Power ...................................................... 0.80
Alpha ....................................................... 0.05
N (Sample Size)...................................... 50
μ0 (Null or Baseline Mean) ..................... 3300
σ (Standard Deviation) ........................... 663

Output
Click the Calculate button to perform the calculations and generate the following output.

Numeric Results ────────────────────────────────────────────────────────────


Hypotheses: H0: μ = μ0 vs. H1: μ ≠ μ0

Diff Effect
Power N μ0 μ1 μ1 - μ0 σ Size Alpha Beta
0.80000 50 3300.0 3037.3 -262.7 663.0 0.396 0.050 0.20000

With a sample of 50, a difference of 3037.3 - 3300 = -262.7 would be detectable.

414-10
© NCSS, LLC. All Rights Reserved.
PASS Sample Size Software NCSS.com
One-Sample Z-Tests

Example 4 – Validation using Chow, Shao, Wang, and Lokhnygina


(2018)
Chow, Shao, Wang, and Lokhnygina (2018) presents an example on pages 45 and 46 of a two-sided one-sample
z-test sample size calculation in which μ0 = 1.5, μ1 = 2.0, σ = 1.0, alpha = 0.05, and power = 0.80. They obtain a
sample size of 32.

Setup
This section presents the values of each of the parameters needed to run this example. First, from the PASS Home
window, load the One-Sample Z-Tests procedure window by expanding Means, then One Mean, then clicking
on Z-Test (Inequality), and then clicking on One-Sample Z-Tests. You may then make the appropriate entries
as listed below, or open Example 4 by going to the File menu and choosing Open Example Template.
Option Value
Design Tab
Solve For ................................................ Sample Size
Alternative Hypothesis ............................ Two-Sided (H1: μ ≠ μ0)
Population Size ....................................... Infinite
Power ...................................................... 0.80
Alpha ....................................................... 0.05
μ0 (Null or Baseline Mean) ..................... 1.5
μ1 (Actual Mean) .................................... 2
σ (Standard Deviation) ........................... 1

Output
Click the Calculate button to perform the calculations and generate the following output.

Numeric Results ────────────────────────────────────────────────────────────


Hypotheses: H0: μ = μ0 vs. H1: μ ≠ μ0

Diff Effect
Power N μ0 μ1 μ1 - μ0 σ Size Alpha Beta
0.80743 32 1.5 2.0 0.5 1.0 0.500 0.050 0.19257

The sample size of 32 matches Chow, Shao, Wang, and Lokhnygina (2018) exactly.

414-11
© NCSS, LLC. All Rights Reserved.
PASS Sample Size Software NCSS.com
One-Sample Z-Tests

Example 5 – Validation using Machin (1997)


Machin, Campbell, Fayers, and Pinol (1997) page 37 presents an example of a one-sample t-test in which μ0 =
0.0, μ1 = 0.2, σ = 1.0, alpha = 0.05, and beta = 0.20. They obtain a sample size of 199. The z-test should give a
similar but slightly lower result because the normal distribution approximates the t distribution very well at this
sample size.

Setup
This section presents the values of each of the parameters needed to run this example. First, from the PASS Home
window, load the One-Sample Z-Tests procedure window by expanding Means, then One Mean, then clicking
on Z-Test (Inequality), and then clicking on One-Sample Z-Tests. You may then make the appropriate entries
as listed below, or open Example 5 by going to the File menu and choosing Open Example Template.
Option Value
Design Tab
Solve For ................................................ Sample Size
Alternative Hypothesis ............................ Two-Sided (H1: μ ≠ μ0)
Population Size ....................................... Infinite
Power ...................................................... 0.80
Alpha ....................................................... 0.05
μ0 (Null or Baseline Mean) ..................... 0
μ1 (Actual mean) .................................... 0.2
σ (Standard Deviation) ........................... 1

Output
Click the Calculate button to perform the calculations and generate the following output.

Numeric Results ────────────────────────────────────────────────────────────


Hypotheses: H0: μ = μ0 vs. H1: μ ≠ μ0

Diff Effect
Power N μ0 μ1 μ1 - μ0 σ Size Alpha Beta
0.80155 197 0.0 0.2 0.2 1.0 0.200 0.050 0.19845

The sample size of 197 is very close to and just less than Machin’s result for the t-test.

414-12
© NCSS, LLC. All Rights Reserved.

You might also like