100% found this document useful (1 vote)
3K views47 pages

T Test and Z Test

Uploaded by

Vaibhav Jain
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
3K views47 pages

T Test and Z Test

Uploaded by

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

Steps Involved in Hypothesis Testing

Fig. 15.3 Formulate H0 and H1

Select Appropriate Test


Choose Level of Significance

Collect Data and Calculate Test Statistic

Determine Determine Critical


Probability Value of Test
Associated with Test Statistic TSCR
Statistic Determine if TSCR
Compare with Level
falls into (Non)
of Significance, 
Rejection Region
Reject or Do not Reject
H0
Draw Marketing Research Conclusion
© 2007 Prentice Hall 15-1
A General Procedure for Hypothesis Testing
Step 1: Formulate the Hypothesis

 A null hypothesis is a statement of the status


quo, one of no difference or no effect. If the null
hypothesis is not rejected, no changes will be
made.
 An alternative hypothesis is one in which
some difference or effect is expected. Accepting
the alternative hypothesis will lead to changes in
opinions or actions.
 The null hypothesis refers to a specified value of
the population parameter (e.g., m, s, p ), not a
sample statistic (e.g., X ).
© 2007 Prentice Hall 15-2
A General Procedure for Hypothesis Testing
Step 1: Formulate the Hypothesis
 A null hypothesis may be rejected, but it can never
be accepted based on a single test. In classical
hypothesis testing, there is no way to determine
whether the null hypothesis is true.
 In marketing research, the null hypothesis is
formulated in such a way that its rejection leads to
the acceptance of the desired conclusion. The
alternative hypothesis represents the conclusion for
which evidence is sought.
H0: p  0.40
H1: p > 0.40
© 2007 Prentice Hall 15-3
A General Procedure for Hypothesis Testing
Step 1: Formulate the Hypothesis

 The test of the null hypothesis is a one-tailed


test, because the alternative hypothesis is
expressed directionally. If that is not the case,
then a two-tailed test would be required,
and the hypotheses would be expressed as:

H 0: p = 0.4 0
H1: p  0.40
© 2007 Prentice Hall 15-4
A General Procedure for Hypothesis Testing
Step 2: Select an Appropriate Test
 The test statistic measures how close the sample
has come to the null hypothesis.
 The test statistic often follows a well-known
distribution, such as the normal, t, or chi-square
distribution.
 In our example, the z statistic, which follows the
standard normal distribution, would be appropriate.
p-p
z=
sp
where
p (1 - p)
sp =
© 2007 Prentice Hall n 15-5
A General Procedure for Hypothesis Testing
Step 3: Choose a Level of Significance
Type I Error
 Type I error occurs when the sample results lead to
the rejection of the null hypothesis when it is in fact
true.
 The probability of type I error ( ) is also called the
level of significance.

Type II Error
 Type II error occurs when, based on the sample
results, the null hypothesis is not rejected when it is in
fact false.
 The probability of type II error is denoted by b .
 Unlike  , which is specified by the researcher, the
magnitude of b depends on the actual value of the
population parameter (proportion).
© 2007 Prentice Hall 15-6
A General Procedure for Hypothesis Testing
Step 3: Choose a Level of Significance
Power of a Test
 The power of a test is the probability (1 - b )
of rejecting the null hypothesis when it is false
and should be rejected.
 Although b is unknown, it is related to  . An
extremely low value of  (e.g., = 0.001) will
result in intolerably high b errors.
 So it is necessary to balance the two types of
errors.

© 2007 Prentice Hall 15-7


Probabilities of Type I & Type II Error
Fig. 15.4

95% of
Total Area
 = 0.05

Z
= 0.40
Z  = 1.645
Critical Value
of Z 99% of
Total Area
b = 0.01
Z
 = 0.45
© 2007 Prentice Hall Z b = -2.33 15-8
Probability of z with a One-Tailed Test
Fig. 15.5

Shaded Area
= 0.9699

Unshaded Area
= 0.0301

0 z = 1.88
© 2007 Prentice Hall 15-9
A General Procedure for Hypothesis Testing
Step 4: Collect Data and Calculate Test
Statistic
 The required data are collected and the value
of the test statistic computed.
 In our example, the value of the sample
proportion is
p = 17/30 = 0.567.
 The value of sp can be determined as follows:

sp = p(1 - p)
n
=
(0.40)(0.6)
30
© 2007 Prentice Hall = 0.089 15-10
A General Procedure for Hypothesis Testing
Step 4: Collect Data and Calculate Test
Statistic

The test statistic z can be calculated as follows:

pˆ - p
z =
s p

= 0.567-0.40
0.089

= 1.88
© 2007 Prentice Hall 15-11
A General Procedure for Hypothesis Testing
Step 5: Determine the Probability
(Critical Value)
 Using standard normal tables (Table 2 of the Statistical
Appendix), the probability of obtaining a z value of
1.88 can be calculated (see Figure 15.5).
 The shaded area between -  and 1.88 is 0.9699.
Therefore, the area to the right of z = 1.88 is 1.0000 -
0.9699 = 0.0301.
 Alternatively, the critical value of z, which will give an
area to the right side of the critical value of 0.05, is
between 1.64 and 1.65 and equals 1.645.
 Note, in determining the critical value of the test
statistic, the area to the right of the critical value is
either  or  /2 . It is  for a one-tail test and
/2 for a two-tail test.
© 2007 Prentice Hall 15-12
A General Procedure for Hypothesis Testing
Steps 6 & 7: Compare the Probability
(Critical Value) and Making the Decision
 If the probability associated with the calculated or
observed value of the test statistic (TS CAL ) is less than
the level of significance ( ), the null hypothesis is
rejected.
 The probability associated with the calculated or
observed value of the test statistic is 0.0301. This is the
probability of getting a p value of 0.567 when  = 0.40.
This is less than the level of significance of 0.05. Hence,
the null hypothesis is rejected.
 Alternatively, if the calculated value of the test statistic is
greater than the critical value of the test statistic (TS CR ),
the null hypothesis is rejected.
© 2007 Prentice Hall 15-13
A General Procedure for Hypothesis Testing
Steps 6 & 7: Compare the Probability
(Critical Value) and Making the Decision

 The calculated value of the test statistic z = 1.88 lies in


the rejection region, beyond the value of 1.645. Again,
the same conclusion to reject the null hypothesis is
reached.

 Note that the two ways of testing the null hypothesis


are equivalent but mathematically opposite in the
direction of comparison.

 If the probability of TS CAL< significance level ( )


then reject H0 but if TS CAL> TS CR then reject H0.
© 2007 Prentice Hall 15-14
Hypothesis Testing Related to Differences
 Parametric tests assume that the variables of interest are
measured on at least an interval scale.
 Nonparametric tests assume that the variables are
measured on a nominal or ordinal scale.
 These tests can be further classified based on whether one
or two or more samples are involved.
 The samples are independent if they are drawn randomly
from different populations. For the purpose of analysis,
data pertaining to different groups of respondents, e.g.,
males and females, are generally treated as independent
samples.
 The samples are paired when the data for the two samples
relate to the same group of respondents.
© 2007 Prentice Hall 15-15
A Classification of Hypothesis Testing
Procedures for Examining Differences
Fig. 15.9 Hypothesis Tests

Parametric Tests Non-parametric Tests


(Metric Tests) (Nonmetric Tests)

One Sample Two or More One Sample Two or More


Samples Samples
* t test * Chi-Square
* Z test * K-S
* Runs
* Binomial
Independen Paired
t Samples Samples Independen Paired
* Two-Group t
t Samples Samples
* Paired * Chi-Square * Sign
test t test
* Z test * Mann-Whitney * Wilcoxon
* Median * McNemar
* K-S * Chi-Square
© 2007 Prentice Hall 15-16
Parametric Tests
 The t statistic assumes that the variable is normally
distributed and the mean is known (or assumed to be
known) and the population variance is estimated from
the sample.
 Assume that the random variable X is normally
distributed, with mean and unknown population variance
that is estimated by the sample variance s 2.
 Then, t = ( X - m )/s X is t distributed with n - 1
degrees of freedom.
 The t distribution is similar to the normal distribution
in appearance. Both distributions are bell-shaped and
symmetric. As the number of degrees of freedom
increases, the t distribution approaches the normal
distribution.
© 2007 Prentice Hall 15-17
Hypothesis Testing Using
the t Statistic
1. Formulate the null (H0) and the alternative (H1)
hypotheses.
2. Select the appropriate formula for the t statistic.
3. Select a significance level, λ , for testing H0.
Typically, the 0.05 level is selected.
4. Take one or two samples and compute the mean
and standard deviation for each sample.
5. Calculate the t statistic assuming H0 is true.
© 2007 Prentice Hall 15-18
Hypothesis Testing Using
the t Statistic
6. Calculate the degrees of freedom and estimate the
probability of getting a more extreme value of the statistic
from Table 4 (Alternatively, calculate the critical value of the
t statistic).
7. If the probability computed in step 5 is smaller than the
significance level selected in step 2, reject H0. If the
probability is larger, do not reject H0. (Alternatively, if the
value of the calculated t statistic in step 4 is larger than the
critical value determined in step 5, reject H0. If the
calculated value is smaller than the critical value, do not
reject H0). Failure to reject H0 does not necessarily imply
that H0 is true. It only means that the true state is not
significantly different than that assumed by H0.
8. Express the conclusion reached by the t test in terms of the
marketing research problem.
© 2007 Prentice Hall 15-19
One Sample : t Test
For the data in Table 15.2, suppose we wanted to test
the hypothesis that the mean familiarity rating exceeds
4.0, the neutral value on a 7 point scale. A significance
level of  = 0.05 is selected. The hypotheses may be
formulated as:
H0 :m < 4.0
H1: m > 4.0
t = (X - m)/sX
sX = s/ n
sX = 1.579/ 29

= 1.579/5.385 = 0.293

© 2007 Prentice Hall t = (4.724-4.0)/0.293 = 0.724/0.293 = 2.471 15-20


One Sample : t Test

The degrees of freedom for the t statistic to test the


hypothesis about one mean are n - 1. In this case,
n - 1 = 29 - 1 or 28. From Table 4 in the Statistical
Appendix, the probability of getting a more extreme
value than 2.471 is less than 0.05 (Alternatively, the
critical t value for 28 degrees of freedom and a
significance level of 0.05 is 1.7011, which is less than
the calculated value). Hence, the null hypothesis is
rejected. The familiarity level does exceed 4.0.
© 2007 Prentice Hall 15-21
One Sample : Z Test
Note that if the population standard deviation was
assumed to be known as 1.5, rather than estimated
from the sample, a z test would be appropriate. In
this case, the value of the z statistic would be:
z = (X - m)/sX
where
s
= X 1.5/ 29 = 1.5/5.385 = 0.279
and
z = (4.724 - 4.0)/0.279 = 0.724/0.279 = 2.595

© 2007 Prentice Hall 15-22


One Sample : Z Test

 From Table 2 in the Statistical Appendix, the probability


of getting a more extreme value of z than 2.595 is less
than 0.05. (Alternatively, the critical z value for a one-
tailed test and a significance level of 0.05 is 1.645,
which is less than the calculated value.) Therefore, the
null hypothesis is rejected, reaching the same
conclusion arrived at earlier by the t test.
 The procedure for testing a null hypothesis with
respect to a proportion was illustrated earlier in this
chapter when we introduced hypothesis testing.

© 2007 Prentice Hall 15-23


Two Independent Samples Means
 In the case of means for two independent samples, the
hypotheses take the following form.

H :m =m
0 1 2

H :m  m
1 1 2

 The two populations are sampled and the means and


variances computed based on samples of sizes n1 and n2.
If both populations are found to have the same variance, a
pooled variance estimate is computed from the two sample
variances as follows:

n1 n2 2 2
(X - X ) + (X - X ) 2 (n 1 - 1) s1 + (n 2-1) s2
2 2

=
2 i =1
i1
or s =
1
i =1
i2 2

s
n + n -2 1
n1 + n2 -2
2
© 2007 Prentice Hall 15-24
Two Independent Samples Means

The standard deviation of the test statistic can be


estimated as:

sX 1 - X 2 = s 2 (n1 + n1 )
1 2

The appropriate value of t can be calculated as:


(X 1 -X 2) - (m1 - m2)
t= sX 1 - X 2

The degrees of freedom in this case are (n1 + n2 -2).


© 2007 Prentice Hall 15-25
Two Independent Samples F Test

An F test of sample variance may be performed if it is


not known whether the two populations have equal
variance. In this case, the hypotheses are:

H0: s
1
2 = s2
2

H1: s
1
2  s2
2

© 2007 Prentice Hall 15-26


Two Independent Samples
F Statistic
The F statistic is computed from the sample variances
as follows
s12
F(n1-1),(n2-1) =
s 2
where 2
n1 = size of sample 1
n2 = size of sample 2
n1-1 = degrees of freedom for sample 1
n2-1 = degrees of freedom for sample 2
s 12 = sample variance for sample 1
s 22 = sample variance for sample 2

Using the data of Table 15.1, suppose we wanted to determine


whether Internet usage was different for males as compared to
females. A two-independent-samples t test was conducted.
The results are presented in Table 15.14.
© 2007 Prentice Hall 15-27
Two Independent-Samples t Tests
Table
15.14
Table 15.14 Summary Statistics

Number Standard
of Cases Mean Deviation

Male 15 9.333 1.137


Female 15 3.867 0.435

F Test for Equality of Variances


F 2-tail
value probability

15.507 0.000

t Test
Equal Variances Assumed Equal Variances Not Assumed

t Degrees of 2-tail t Degrees of 2-tail


value freedom probability value freedom probability

- 4.492 28 0.000 -4.492 18.014 0.000

© 2007 Prentice Hall 15-28


Two Independent Samples
Proportions
The case involving proportions for two independent samples
is also illustrated using the data of Table 15.1, which gives
the number of males and females who use the Internet for
shopping. Is the proportion of respondents using the
Internet for shopping the same for males and females?
The null and alternative hypotheses are:
H0 : p1 = p2
H1: p1  p2

A Z test is used as in testing the proportion for one sample.


However, in this case the test statistic is given by:
P -P
Z=1 2

© 2007 Prentice Hall S P1- p 2 15-29


Two Independent Samples Proportions

In the test statistic, the numerator is the difference


between the proportions in the two samples, P1 and
P2. The denominator is the standard error of the
difference in the two proportions and is given by
1 1
S P1- p 2 = P(1 - P) + 
 n1 n2 

where
n1P1 + n2P2
P = n1 + n2
© 2007 Prentice Hall 15-30
Two Independent Samples Proportions

A significance level of  = 0.05 is selected. Given the


data of Table 15.1, the test statistic can be calculated as:

P -P 1 2 = (11/15) -(6/15)

= 0.733 - 0.400 = 0.333

P = (15 x 0.733+15 x 0.4)/(15 + 15) = 0.567


S P1- p 2 0.567 x 0.433 [ 1 + 1 ]
15 15
= = 0.181

Z = 0.333/0.181 = 1.84
© 2007 Prentice Hall 15-31
Two Independent Samples
Proportions

Given a two-tail test, the area to the right of the


critical value is 0.025. Hence, the critical value of the
test statistic is 1.96. Since the calculated value is less
than the critical value, the null hypothesis can not be
rejected. Thus, the proportion of users (0.733 for
males and 0.400 for females) is not significantly
different for the two samples. Note that while the
difference is substantial, it is not statistically significant
due to the small sample sizes (15 in each group).

© 2007 Prentice Hall 15-32


Paired Samples
The difference in these cases is examined by a paired
samples t test. To compute t for paired samples, the
paired difference variable, denoted by D, is formed and its
mean and variance calculated. Then the t statistic is
computed. The degrees of freedom are n - 1, where n is
the number of pairs. The relevant
formulas are:
H0 : m D = 0
H1: m D  0

D - mD
tn-1 = sD
n
continued…
© 2007 Prentice Hall 15-33
Paired Samples
Where:
n
S Di
D = i=1n
n
S=1 (Di - D)2
sD = i
n-1

S
SD = n
D

In the Internet usage example (Table 15.1), a paired


t test could be used to determine if the respondents
differed in their attitude toward the Internet and
attitude toward technology. The resulting output is
shown in Table 15.15.
© 2007 Prentice Hall 15-34
Paired-Samples t Test
Table 15.15
Number Standard Standard
Variable of Cases Mean Deviation Error

Internet Attitude 30 5.167 1.234 0.225


Technology Attitude 30 4.100 1.398 0.255

Difference = Internet
- - Technology

Difference Standard Standard 2-tail t Degrees of 2-tail


Mean deviation error Correlation prob. value freedom probability

1.067 0.828 0.1511 0.809 0.000 7.059 29 0.000

© 2007 Prentice Hall 15-35


Nonparametric Tests

Nonparametric tests are used when the


independent variables are nonmetric. Like
parametric tests, nonparametric tests are available
for testing variables from one sample, two
independent samples, or two related samples.

© 2007 Prentice Hall 15-36


SPSS Windows
 The main program in SPSS is FREQUENCIES. It produces
a table of frequency counts, percentages, and cumulative
percentages for the values of each variable. It gives all
of the associated statistics.
 If the data are interval scaled and only the summary
statistics are desired, the DESCRIPTIVES procedure can
be used.
 The EXPLORE procedure produces summary statistics
and graphical displays, either for all of the cases or
separately for groups of cases. Mean, median, variance,
standard deviation, minimum, maximum, and range are
some of the statistics that can be calculated.
© 2007 Prentice Hall 15-37
SPSS Windows
To select these procedures click:

Analyze>Descriptive Statistics>Frequencies
Analyze>Descriptive Statistics>Descriptives
Analyze>Descriptive Statistics>Explore

The major cross-tabulation program is CROSSTABS.


This program will display the cross-classification tables
and provide cell counts, row and column percentages, the
chi-square test for significance, and all the measures of
the strength of the association that have been discussed.

To select these procedures click:

Analyze>Descriptive Statistics>Crosstabs
© 2007 Prentice Hall 15-38
SPSS Windows
The major program for conducting parametric
tests in SPSS is COMPARE MEANS. This program can
be used to conduct t tests on one sample or
independent or paired samples. To select these
procedures using SPSS for Windows click:

Analyze>Compare Means>Means …
Analyze>Compare Means>One-Sample T Test …
Analyze>Compare Means>Independent- Samples T Test …
Analyze>Compare Means>Paired-Samples T Test …
© 2007 Prentice Hall 15-39
SPSS Windows
The nonparametric tests discussed in this chapter can
be conducted using NONPARAMETRIC TESTS.

To select these procedures using SPSS for Windows


click:

Analyze>Nonparametric Tests>Chi-Square …
Analyze>Nonparametric Tests>Binomial …
Analyze>Nonparametric Tests>Runs …
Analyze>Nonparametric Tests>1-Sample K-S …
Analyze>Nonparametric Tests>2 Independent Samples …
Analyze>Nonparametric Tests>2 Related Samples …
© 2007 Prentice Hall 15-40
SPSS Windows: Frequencies
1. Select ANALYZE on the SPSS menu bar.
2. Click DESCRIPTIVE STATISTICS and select
FREQUENCIES
3. Move the variable “Familiarity [familiar]” to the
VARIABLE(s) box.
4. Click STATISTICS
5. Select MEAN, MEDIAN, MODE, STD. DEVIATION,
VARIANCE, and RANGE.
© 2007 Prentice Hall 15-41
SPSS Windows:
Frequencies
6. Click CONTINUE
7. Click CHARTS
8. Click HISTOGRAMS, then click CONTINUE
9. Click OK

© 2007 Prentice Hall 15-42


SPSS Windows: Cross-tabulations
1. Select ANALYZE on the SPSS menu bar.
2. Click on DESCRIPTIVE STATISTICS and
select CROSSTABS
3. Move the variable “Internet Usage
Group [iusagegr]” to the ROW(S) box.
4. Move the variable “Sex[sex]” to the
COLUMN(S) box.
5. Click on CELLS.
6. Select OBSERVED under COUNTS and
COLUMN under PERCENTAGES.
© 2007 Prentice Hall 15-43
SPSS Windows: Cross-tabulations
7. Click CONTINUE

8. Click STATISTICS

9. Click on CHI-SQUARE, PHI AND CRAMER’S V.

10. Click CONTINUE.

11. Click OK.

© 2007 Prentice Hall 15-44


SPSS Windows:
One Sample t Test
1. Select ANALYZE from the SPSS menu bar.
2. Click COMPARE MEANS and then ONE
SAMPLE T TEST.
3. Move “Familiarity [familiar]” in to the
TEST VARIABLE(S) box.
4. Type “4” in the TEST VALUE box.
5. Click OK.

© 2007 Prentice Hall 15-45


SPSS Windows:
Two Independent Samples t Test
1. Select ANALYZE from the SPSS menu bar.
2. Click COMPARE MEANS and then INDEPENDENT
SAMPLES T TEST.
3. Move “Internet Usage Hrs/Week [iusage]” in to the
TEST VARIABLE(S) box.
4. Move “Sex[sex]” to GROUPING VARIABLE box.
5. Click DEFINE GROUPS.
6. Type “1” in GROUP 1 box and “2” in GROUP 2 box.
7. Click CONTINUE.
8. Click OK.
© 2007 Prentice Hall 15-46
SPSS Windows: Paired Samples t Test
1. Select ANALYZE from the SPSS menu bar.

2. Click COMPARE MEANS and then PAIRED SAMPLES T


TEST.

3. Select “Attitude toward Internet [iattitude]” and then


select “Attitude toward technology [tattitude].” Move
these variables in to the PAIRED VARIABLE(S) box.

4. Click OK.

© 2007 Prentice Hall 15-47

You might also like