You are on page 1of 11

Recipe Book.

Week 2: One sample tests


Purpose: Testing hypotheses about a sample mean relative to a population.
Tests: z-test and one-sample t-test
If you know population mean () and standard deviation () use the z test, otherwise use the one
sample t-test.

z-test (Used when population mean and standard deviation known)


Assumptions:
Data is quantitative and on an interval scale that has been randomly and independently sampled
from a normally distributed population.

Mechanics (cf J&B Steps in hypothesis testing p. 227-229):
1. Specify null and alternative hypotheses.
Null hypothesis (H
0
): No difference


Alternative (H
1
): Two-tailed:

;
One-tailed:

or


(We will use

, the sample mean, as the best estimate of

,the mean of the population that


the sample is drawn from.)

2. Choose alpha () and determine critical value of statistic
e.g.1 For alpha .05 (5%) then z
crit
= +/-1.96 for a two tailed test
e.g.2 For alpha .05 (5%) then z
crit
= +/-1.645 for a one tailed test
e.g. 3 For alpha .01 (1%) then z
crit
= +/-2.575 for a two tailed test


3. Characterize the mean and standard error of the sampling distribution of the mean if the null
hypothesis is true
Mean: =
X

(estimated using


Standard error:

(the standard deviation of the population divided by squareroot of N)


Where
X
and

and are the mean and standard deviation of sampling distribution of the mean,
and are the mean and standard deviation of the population, and N is the sample size..

4. Convert observed mean into a z-score:


Where

is the sample mean, is the hypothesised population mean and

is the standard error



5. Compare observed z with z
crit

For a two tailed hypothesis alternative hypothesis,

, reject the null hypothesis if observed z is


more extreme than the critical value (e.g. z >+1.96 or z<-1.96 for alpha = 5%). Note the direction of
the difference (and mention this in the results). If z is within the range of critical values, do not
reject the null hypothesis.
For a one-tailed hypothesis, e.g.

, reject the null hypothesis if observed z is more extreme in


the predicted direction than the critical value (e.g. z >+1.645 for alpha = 5%)
6. Summarize the results and your conclusion in APA format.
e.g. A two-sample z test using an alpha level of .05 showed that the average IQ for PSYC250
students, 120 IQ points (N=100), was significantly greater than the average for the general
population, =100 IQ points (=15 IQ points), z = 13.33, p<<.001, two-tailed. This suggests
that the average IQ of PSYC250 students is above that of the population in general. The 95%
confidence interval for the mean was between 117.06 and 122.94
Confidence Interval
1. Sample mean


2. Standard error of mean


3. z
crit
two-tailed
e.g. For a 95% confidence interval then z
crit
= 1.96
CI is from

to


One sample t-test (Used when population mean and standard deviation not known):


Assumptions:
Data is quantitative and on an interval scale that has been randomly and independently sampled
from a normally distributed population.

Mechanics (cf J&B Steps in hypothesis testing p. 227-229):
1. Specify null and alternative hypotheses.
Null hypothesis (H
0
): No difference


Alternative (H
1
): Two-tailed:

;
One-tailed:

or


(We will again use

, the sample mean, as the best estimate of

,the mean of the


population that the sample is drawn from.)

2. Choose alpha () and determine critical value of statistic
e.g. Choose alpha .05 (5%).
t
crit
will depend on the degrees of freedom, df = N-1, as well as on alpha.
e.g.1 For a sample size of N = 30, df = 30-1 = 29, for alpha = 5%, t
crit
(29)

= +/-2.045 (two-tailed).
e.g. 2 For a sample size of N = 10, df = 10-1 = 9, for alpha = 5%, t
crit
(9)

= 1.833 (one-tailed with sign
according to predicted direction).
Note, tcrit slightly larger than the zcrit for the same alpha and type of hypothesis (one or two tailed)
due to the fatter tails of the t-distribution. The equivalent zcrit values are +/-1.96 and 1.645 for
e.g.s 1 and 2 respectively.

3. Calculate mean and standard deviation of the sampling distribution of the mean if the null
hypothesis is true
Mean: =
X


Where is the estimated population standard deviation based on the sample standard deviation and
N, the sample size.
Estimating the variance of the population from the sample:


Where SS is the Sum of Squares.
, needed for calculating

, is the square root of



4. Convert observed mean into a t-score:


Where t is the observed t-score,

is the sample mean, is the population mean and

is the
estimated standard error

5. Compare observed t with t
crit
.
If observed t is more extreme than the critical value, e.g. t(29) >+2.045 or t(29) <-2.045 for two-tailed
alpha= 5%, reject the null hypothesis and note the direction of the difference.
If t is within the range of critical values, do not reject the null hypothesis

6. Summarize the results and your conclusion in APA format.
e.g. A one-sample t test using an alpha level of .05 was used to compare accommodation
satisfaction ratings on a 8-point scale to the neutral rating of 4.5. The sample mean of 5.60
(SD=1.51) was found to be statistically significantly higher than the neutral rating, t(9) = 2.31,
p<.05, two-tailed, suggesting that the mean accommodation rating is greater than 4.5. The
95% confidence interval of the mean was from 4.63 to 6.57
Confidence Interval
1. Sample mean


2. Standard error of mean


3. t
crit
(df) two-tailed
CI is from

to


E.g. For a sample size of N = 30, df = 30-1 = 29, for the 95% confidence interval, t(29)
crit
= 2.045 (two-
tailed). i.e. CI is from 5.6 (2.045 * 0.476) = 4.63 to 5.6 + (2.045 * 0.476) = 6.57 (ie. 5.6 +/- .97).
Please note values from example used in lectures
Week 3: Two sample tests
Purpose: Testing for differences between two population samples
Tests: Independent and correlated groups t tests.
Both tests require a quantitative DV that is measured on an interval scale and an IV with two levels.
If both samples come from the same group of people use the correlated groups t-test (within
subjects), if the samples come from different groups of people use the independent groups t-test
(between subjects).

Independent groups two sample t-test (Used when IV varies between subjects):


Assumptions:
Data for both groups is quantitative, on an interval scale and has been randomly and independently
sampled from normally distributed populations with equal variances (homogeneity of variance).
Mechanics (cf J&B Steps in hypothesis testing p. 227-229):

1. Specify null and alternative hypotheses.
Null hypothesis (H
0
): No difference,

(Usually)
Alternative (H
1
): Two-tailed:

; One-tailed:

or


Where
1
and
1
are the population means for samples 1 and 2 respectively

2. Choose alpha () and determine critical value of statistic
e.g. Choose alpha .05 (5%).
t
crit
depends on the degrees of freedom (df), N-2, as well as on alpha.
E.g. For equal sample sizes n
1
= 15 and n
2
= 15 (N=30), df = 30-2 = 28
For alpha = 5%, t(28)
crit
= +/-2.048 (two-tailed)




3. Calculate mean and standard deviation of the sampling distribution of the difference between
population means if the null hypothesis is true
Mean difference between group means:
1
-
2
= 0.
Standard deviation:

) (

is the estimated standard error of the difference between group means,

and

, SS
1
and SS
s
and n
1
and n
2
are the sample mean, sum of squares and sample size for groups
1 and 2 respectively.

4. Convert observed means into a t-score:


Where t is the observed t-score,

and

are the group means and

is the standard error of


the sampling distribution of the difference between the group means.

(Assumes

(i.e.

. Otherwise
(


where

and

are the hypothesised means of the populations from which the samples are
drawn)

5. Compare observed t with t
crit
.
If observed t is more extreme (e.g. t(28) >+2.048 or t(28)<-2.048) than the critical value, reject the
null hypothesis and note the direction of the difference.
If t is within the range of critical values, do not reject the null hypothesis

6. Summarize the results and your conclusion in APA format.





Confidence Interval
1. Score of interest



2. Estimated standard error of distribution

3. t
crit
(df) two-tailed
E.g. For equal sample sizes n
1
= 15 and n
2
= 15 (N=30), df = 30-2 = 28, , for the 95% confidence
interval, t(28)
crit
= 2.048 (two-tailed)

CI is from

) to

)


Effect Size


|
|
.
|

\
|
+
|
|
.
|

\
|
+
+
=

2 1 2 1
2 1
1 1
2

2 1
n n n n
SS SS
s
X X
df t
t
eta
+
=
2
2
2
pooled
s
X X
d

2 1

=
|
|
.
|

\
|
+
+
=
2

2 1
2 1
n n
SS SS
s
pooled
Correlated groups two sample t-test (Used when IV varies within subjects):


Assumptions:
Data is quantitative and on an interval scale. The sample has been randomly and independently
selected from the population of interest. The population of difference scores is normally distributed.

Mechanics (cf J&B Steps in hypothesis testing p. 227-229):

1. Specify null and alternative hypotheses.
Null hypothesis (H
0
): No difference,

(i.e.

)
Alternative (H
1
):
Two-tailed:

0);
One-tailed:

OR

)
Where
1
and
1
are the population means for sample 1 and 2 respectively and
D
is the mean of the
population of difference scores.

2. Choose alpha () and determine critical value of statistic
e.g. Choose alpha .05 (5%).
t
crit
depends on the degrees of freedom (df), N-1, as well as on alpha.
E.g. For N=30, df = 30-1 = 29
For alpha = 5%, t(29)
crit
= +/-2.045 (two-tailed)

3. Assuming that the null hypothesis is true, calculate mean and standard deviation of the sampling
distribution of the mean difference (

) if the null hypothesis is true


Mean:

)
Standard deviation:


Where

is the mean of the sampling distribution of difference scores, and


1
and
2
are the
population means for samples 1 and 2 respectively.

is the standard deviation of the population


of difference scores estimated from the sample difference scores while

is the standard error of


the mean of difference scores.
( )
1 1

2
2

E
E
=
|
.
|

\
|

=
N
N
D
D
N
SS
s
D
D

4. Convert observed means into a t-score:


Where

is the sample mean difference and

is the estimated standard error of the mean scores.



5. Compare observed t with t
crit
.
If observed t is more extreme (e.g. t(29) >+2.045 or t(29)<-2.045) than the critical value, reject the
null hypothesis and note the direction of the difference.
If t is within the range of critical values, do not reject the null hypothesis

6. Summarize the results and your conclusion in APA format.



Confidence Interval
1. Score of interest


2. Estimated standard error of distribution


3. t
crit
(df) two-tailed
E.g. For N=30, df = 30-1 = 29 then, for the 95% confidence interval, t(29)
crit
= 2.045 (two-tailed)
CI is from

to



Effect size


df t
t
eta
+
=
2
2
2
D
s
D
d

=
APA format
include information about the obtained magnitude of the test statistic, the degrees of freedom, the
probability of obtaining a value as extreme or more extreme than the one obtained, and the
direction of the effect. Be sure to include sufficient descriptive statistics (e.g. per-cell sample sizes,
means, correlations, standard deviations) so that the nature of the effect being reported can be
understood by the reader. J&B 8.12
Checklist
1) State what test was done and why
2) Magnitude of test statistic
3) Degree of freedom
4) Probability
5) Direction
6) Descriptive statistics
7) Confidence interval
8) Effect size
9) The nature of the effect being reported can be understood by the reader?




Glossary
Between subjects independent groups
DV Dependent Variable
IV Independent Variable
One-tailed hypothesis Directional hypothesis
Two-tailed hypothesis Non-directional hypothesis
Standard error (SE or SEM) standard deviation (of a sampling distribution)
Within subjects repeated measures correlated groups paired samples ( matched samples)
- population mean
population standard deviation

You might also like