The TTEST Procedure

One-Sample Design

Define the following notation:

StartLayout 1st Row 1st Column n Superscript star 2nd Column equals number of observations in data set 2nd Row 1st Column y Subscript i 2nd Column equals value of i th observation comma i element-of StartSet 1 comma ellipsis comma n Superscript star Baseline EndSet 3rd Row 1st Column f Subscript i 2nd Column equals frequency of i th observation comma i element-of StartSet 1 comma ellipsis comma n Superscript star Baseline EndSet 4th Row 1st Column w Subscript i 2nd Column equals weight of i th observation comma i element-of StartSet 1 comma ellipsis comma n Superscript star Baseline EndSet 5th Row 1st Column n 2nd Column equals sample size equals sigma-summation Underscript i Overscript n Superscript star Baseline Endscripts f Subscript i Baseline EndLayout
Normal Data (DIST=NORMAL)

The mean estimate y overbar, standard deviation estimate s, and standard error normal upper S normal upper E are computed as follows:

StartLayout 1st Row 1st Column y overbar 2nd Column equals StartFraction sigma-summation Underscript i Overscript n Superscript star Baseline Endscripts f Subscript i Baseline w Subscript i Baseline y Subscript i Baseline Over sigma-summation Underscript i Overscript n Superscript star Baseline Endscripts f Subscript i Baseline w Subscript i Baseline EndFraction 2nd Row 1st Column s 2nd Column equals left-parenthesis StartFraction sigma-summation Underscript i Overscript n Superscript star Baseline Endscripts f Subscript i Baseline w Subscript i Baseline left-parenthesis y Subscript i Baseline minus y overbar right-parenthesis squared Over n minus 1 EndFraction right-parenthesis Superscript one-half Baseline 3rd Row 1st Column normal upper S normal upper E 2nd Column equals StartFraction s Over left-parenthesis sigma-summation Underscript i Overscript n Superscript star Baseline Endscripts f Subscript i Baseline w Subscript i Baseline right-parenthesis Superscript one-half Baseline EndFraction EndLayout

The 100(1 – alpha)% confidence interval for the mean mu is

StartLayout 1st Row 1st Column left-parenthesis y overbar minus t Subscript 1 minus StartFraction alpha Over 2 EndFraction comma n minus 1 Baseline normal upper S normal upper E comma y overbar plus t Subscript 1 minus StartFraction alpha Over 2 EndFraction comma n minus 1 Baseline normal upper S normal upper E right-parenthesis 2nd Column comma SIDES equals 2 2nd Row 1st Column left-parenthesis negative normal infinity comma y overbar plus t Subscript 1 minus alpha comma n minus 1 Baseline normal upper S normal upper E right-parenthesis 2nd Column comma SIDES equals upper L 3rd Row 1st Column left-parenthesis y overbar minus t Subscript 1 minus alpha comma n minus 1 Baseline normal upper S normal upper E comma normal infinity right-parenthesis 2nd Column comma SIDES equals upper U EndLayout

The t value for the test is computed as

t equals StartFraction y overbar minus mu 0 Over normal upper S normal upper E EndFraction

The p-value of the test is computed as

p hyphen value equals StartLayout Enlarged left-brace 1st Row 1st Column upper P left-parenthesis t squared greater-than upper F Subscript 1 minus alpha comma 1 comma n minus 1 Baseline right-parenthesis comma 2nd Column two hyphen sided 2nd Row 1st Column upper P left-parenthesis t less-than t Subscript alpha comma n minus 1 Baseline right-parenthesis comma 2nd Column lower one hyphen sided 3rd Row 1st Column upper P left-parenthesis t greater-than t Subscript 1 minus alpha comma n minus 1 Baseline right-parenthesis comma 2nd Column upper one hyphen sided EndLayout

The equal-tailed confidence interval for the standard deviation (CI=EQUAL) is based on the acceptance region of the test of upper H 0 colon sigma equals sigma 0 that places an equal amount of area (StartFraction alpha Over 2 EndFraction) in each tail of the chi-square distribution:

StartSet chi Subscript StartFraction alpha Over 2 EndFraction comma n minus 1 Superscript 2 Baseline less-than-or-equal-to StartFraction left-parenthesis n minus 1 right-parenthesis s squared Over sigma 0 squared EndFraction less-than-or-equal-to chi Subscript StartFraction 1 minus alpha Over 2 EndFraction comma n minus 1 Superscript 2 Baseline EndSet

The acceptance region can be algebraically manipulated to give the following 100(1 – alpha)% confidence interval for sigma squared:

left-parenthesis StartFraction left-parenthesis n minus 1 right-parenthesis s squared Over chi Subscript 1 minus StartFraction alpha Over 2 EndFraction comma n minus 1 Superscript 2 Baseline EndFraction comma StartFraction left-parenthesis n minus 1 right-parenthesis s squared Over chi Subscript StartFraction alpha Over 2 EndFraction comma n minus 1 Superscript 2 Baseline EndFraction right-parenthesis

Taking the square root of each side yields the 100(1 – alpha)% CI=EQUAL confidence interval for sigma:

left-parenthesis left-parenthesis StartFraction left-parenthesis n minus 1 right-parenthesis s squared Over chi Subscript 1 minus StartFraction alpha Over 2 EndFraction comma n minus 1 Superscript 2 Baseline EndFraction right-parenthesis Superscript one-half Baseline comma left-parenthesis StartFraction left-parenthesis n minus 1 right-parenthesis s squared Over chi Subscript StartFraction alpha Over 2 EndFraction comma n minus 1 Superscript 2 Baseline EndFraction right-parenthesis Superscript one-half Baseline right-parenthesis

The other confidence interval for the standard deviation (CI=UMPU) is derived from the uniformly most powerful unbiased test of upper H 0 colon sigma equals sigma 0 (Lehmann 1986). This test has acceptance region

StartSet c 1 less-than-or-equal-to StartFraction left-parenthesis n minus 1 right-parenthesis s squared Over sigma 0 squared EndFraction less-than-or-equal-to c 2 EndSet

where the critical values c 1 and c 2 satisfy

integral Subscript c 1 Superscript c 2 Baseline f Subscript n minus 1 Baseline left-parenthesis y right-parenthesis d y equals 1 minus alpha

and

integral Subscript c 1 Superscript c 2 Baseline y f Subscript n minus 1 Baseline left-parenthesis y right-parenthesis d y equals left-parenthesis n minus 1 right-parenthesis left-parenthesis 1 minus alpha right-parenthesis

where f Subscript nu Baseline left-parenthesis y right-parenthesis is the PDF of the chi-square distribution with nu degrees of freedom. This acceptance region can be algebraically manipulated to arrive at

upper P left-brace StartFraction left-parenthesis n minus 1 right-parenthesis s squared Over c 2 EndFraction less-than-or-equal-to sigma squared less-than-or-equal-to StartFraction left-parenthesis n minus 1 right-parenthesis s squared Over c 1 EndFraction right-brace equals 1 minus alpha

where c 1 and c 2 solve the preceding two integrals. To find the area in each tail of the chi-square distribution to which these two critical values correspond, solve c 1 equals chi Subscript 1 minus alpha 2 comma n minus 1 Superscript 2 and c 2 equals chi Subscript alpha 1 comma n minus 1 Superscript 2 for alpha 1 and alpha 2; the resulting alpha 1 and alpha 2 sum to alpha. Hence, a 100(1 – alpha)% confidence interval for sigma squared is given by

left-parenthesis StartFraction left-parenthesis n minus 1 right-parenthesis s squared Over chi Subscript 1 minus alpha 2 comma n minus 1 Superscript 2 Baseline EndFraction comma StartFraction left-parenthesis n minus 1 right-parenthesis s squared Over chi Subscript alpha 1 comma n minus 1 Superscript 2 Baseline EndFraction right-parenthesis

Taking the square root of each side yields the 100(1 – alpha)% CI=UMPU confidence interval for sigma:

left-parenthesis left-parenthesis StartFraction left-parenthesis n minus 1 right-parenthesis s squared Over chi Subscript 1 minus alpha 2 comma n minus 1 Superscript 2 Baseline EndFraction right-parenthesis Superscript one-half Baseline comma left-parenthesis StartFraction left-parenthesis n minus 1 right-parenthesis s squared Over chi Subscript alpha 1 comma n minus 1 Superscript 2 Baseline EndFraction right-parenthesis Superscript one-half Baseline right-parenthesis
Lognormal Data (DIST=LOGNORMAL)

The DIST=LOGNORMAL analysis is handled by log-transforming the data and null value, performing a DIST=NORMAL analysis, and then transforming the results back to the original scale. This simple technique is based on the properties of the lognormal distribution as discussed in Johnson, Kotz, and Balakrishnan (1994, Chapter 14).

Taking the natural logarithms of the observation values and the null value, define

StartLayout 1st Row 1st Column z Subscript i 2nd Column equals log left-parenthesis y Subscript i Baseline right-parenthesis comma i element-of StartSet 1 comma ellipsis comma n Superscript star Baseline EndSet 2nd Row 1st Column gamma 0 2nd Column equals log left-parenthesis mu 0 right-parenthesis EndLayout

First, a DIST=NORMAL analysis is performed on StartSet z Subscript i Baseline EndSet with the null value gamma 0, producing the mean estimate z overbar, the standard deviation estimate s Subscript z, a t value, and a p-value. The geometric mean estimate ModifyingAbove gamma With caret and the CV estimate ModifyingAbove upper C upper V With caret of the original lognormal data are computed as follows:

StartLayout 1st Row 1st Column ModifyingAbove gamma With caret 2nd Column equals exp left-parenthesis z overbar right-parenthesis 2nd Row 1st Column ModifyingAbove upper C upper V With caret 2nd Column equals left-parenthesis exp left-parenthesis s Subscript z Superscript 2 Baseline right-parenthesis minus 1 right-parenthesis Superscript one-half EndLayout

The t value and p-value remain the same. The confidence limits for the geometric mean and CV on the original lognormal scale are computed from the confidence limits for the arithmetic mean and standard deviation in the DIST=NORMAL analysis on the log-transformed data, in the same way that ModifyingAbove gamma With caret is derived from z overbar and ModifyingAbove upper C upper V With caret is derived from s Subscript z.

Last updated: December 09, 2022