PSYC 210: Introduction to Data Analysis
Lecture 7: One sample and Dependent samples??????-tests
Ric Hohn
1
One sample / One Variable
Scenarios
Test SelectionFactors to Consider…
Our focus to this point has been on understanding the conceptual
underpinnings of statistical inference
•Sampling distributions
•NHST logic
In doing so, we’ve used the??????-test as our demonstration of astatistical test
⟶Here the termsstatistical testandhypothesis testrefer to an instance of
conducting statistical inference
2
Test Selection Factors to Consider…
As we navigate the remainder of the course, we will continue to learn other
statistical tests beyond the??????-test
Here’s a small list of some of the tests we will encounter:
•??????-test
•one sample??????-test
•dependent-samples??????-test
•independent-samples??????-test
•and so on…
Thus, we have to be considerate of which statistical test we conduct and
make sure we pick the correct test for the correct situation
3
Test Selection Factors to Consider…
There are two factors that affect which statistical test we should use to
evaluate a research hypothesis:
1.Research design
2.Whether we know (or feel comfortable specifying/assuming) the
parameter values (e.g.,??????,??????
2
,??????)
4
Test Selection Research Design
Research designrefers to how research is conducted and is a broad term to
reflect all the different decisions made along the research process
Different research designs are used to test different kinds of hypotheses and
there arebest practicesconcerning which research design should be used in
a given situation
Aspects of Research Design
•How was sampling conducted?
•How many variables are of interest?
•Is the aim to compare different groups?
•Is the aim to understand how something changes over time?
•Is the aim to predict something from something else?
•Is the aim to understand how two variables relate to one another?
•If comparing different groups, how many groups are there?
•Some combination of these design characteristics...
5
Test Selection Parameter Values
Another consideration is whether we know, or feel comfortable
specifying/assuming, specific values for the population parameters relative
to the test
Put simply, whether we know (or can assume) values for the population
mean (??????) and population variance (??????
2
)
In practice, we rarely know values for parameters or feel comfortable
assuming what they are, and instead weestimate the parameters using
sample statistics
•??????is chosen by the researcher
•??????
2
⟶
̂
??????
2
•?????? ⟶ ̂??????
6
Test Selection Parameter Values
The??????-test is only used when we compare a single group to a population and
when when know (or can assume to know) the values for the population
mean (??????) and population variance (??????
2
)
•This reflects a very idealized scenario that never really happens in
practice
7
Test Selection Parameter Values
Parameter estimation occurs in virtually every statistical test we use in
practice
Our aim for the next two lectures is to focus on tests that accommodate
parameter estimation for one-, two-, or multiple-group research designs
•one-sample??????-test (one group; one-sample)
•dependent-samples??????-test (one group over two time points;
two-sample)
•independent-samples??????-test (two groups; two-sample)
•analysis of variance (3+ groups; 3+ samples)
8
One-sample??????-test
One-sample??????-test Differences from??????
When we need to estimate the population variance (or standard deviation),
we can no longer use the??????-distribution…
Instead we have to use a new metric: the??????-metric
9
One-sample??????-test Differences from??????
Though they are very similar, there are a few differences between the
??????-metric and??????-metric…
•The??????-metric uses anestimateof population variance (or standard
deviation), rather than some know population variance itself
•The??????-metric is applied to afamily of theoretical distributionscalled
??????-distributions
10
One-sample??????-test Estimation
The�-metric uses an estimate of population variance (or standard deviation)
Because we don’t have access to our populations of interest, the only way
we can make inferences about them orestimatetheir parameters is by using
sample data
•Last week we talked about how the sample mean can be thought of as
an estimate of the population mean, which we evaluate via NHST
So how does this work for the population variance?…
We can use the sample variance as an estimate of the population variance!
11
One-sample??????-test Estimation
Remember back to Lecture 3, when we said there are two equations for the sample
variance?
Time for a HUGE clarification!
It isveryuncommon to see the variance equation written as:
�
2
=
∑(??????
??????− ̄??????)
2
??????
Far more commonly, it is written as:
�
2
=
∑(??????
??????− ̄??????)
2
N−1
The difference between the two comes from whether one is conducting data analysis or using
the variance in statistical inference
•??????for data analysis
•?????? − 1for statistical inference
12
One-sample??????-test Estimation
When we use?????? − 1in the denominator, we areestimatingthe population
variance
Estimation of the population variance
̂??????
2
= ??????
2
=
∑(??????
??????− ̄??????)
2
?????? − 1
The?????? − 1denominator is more specifically called thedegrees of freedom
Degrees of freedomare the number of independent pieces of information
remaining after estimating one or more parameters
13
One-sample??????-test Estimation
We don’t need to get too bogged down by the theory of degrees of freedom,
but here’s a quick explanation of what they are
Imagine you had a set of five numbers…
•If four of the numbers are revealed to be [3, 8, 5, and 4] and the average
of all five numbers is 6, then there is no freedom of variation for what
the fifth number must be…
•It has to be 10 because no other value will result in a mean of 6
̄?????? =
3 + 8 + 5 + 4 +10
5
= 6
14
One-sample??????-test Estimation
More practically, we use degrees of freedom for the estimation of variance
because it reduces thebiasof our estimation
•This simply means that it produces a more accurate estimate of the
population variance
15
One-sample??????-test Distributions
The�-metric is applied to a family of theoretical distributions called�-distributions
So far, we’ve worked with the??????-distribution, which is a transformed normal
distribution and therefore has all the properties of the normal distribution
•If a distribution is normal, it will maintain those properties no matter
the values of??????and??????
2
•The shape of the distribution may change (i.e., more wide or more
narrow), but the properties remain
•68% between±??????from the mean, etc…
The??????-metric does not work this way, which is why we reference afamily of
t-distributions
•There is a different??????-distribution for each possible value of degrees of
freedom
•The various??????-distributions do not all have the same properties
16
One-sample??????-test Distributions
As the degrees of freedom, denoted??????or oftentimes as��, changes, so does
the shape of the??????-distribution
•Although the�-distributions are symmetrical curves, they are not normal distributions
•However, as the degrees of freedom approach∞, the�-distributions approach normality
•The higher the degrees of freedom, the closer to normal the given�-distribution is
17
One-sample??????-test Distributions
Here’s yet another awesome interactive visualization to help illustrate this:
https://rpsychologist.com/d3/tdist/
18
One-sample??????-test Distributions
There are a few implications of using??????-distributions compared to a
??????-distribution…
•??????-distributions tend have larger tails
•The critical values will differ forevery??????-distribution
•The??????-table is different from the??????-table
•It contains less information: only critical values
•??????
??????��
calculator:https://www.socscistatistics.com/pvalues/
tdistribution.aspx
19
One-sample??????-test Distributions
Imagine we want to conduct a two-tailed test with?????? = .05. What would the
critical values be?…
•?????? = 1.96, for all sample sizes
•??????
1= 12.706, for?????? = 2
•??????
5= 2.571, for?????? = 6
•??????
30= 2.042, for?????? = 31
•??????
100= 1.984, for?????? = 101
•??????
∞= 1.960, for?????? = ∞
20
One-sample??????-test NHST
In terms of NHST, we will still apply our same procedure as before, with
several small adjustments:
First, we need to select the appropriate??????-distribution based on our degrees
of freedom and extract its critical value(s)
Next, we need toestimatethe population standard deviation (i.e., calculate
sample standard deviation) and subsequently the standard error
Standard Error one-sample??????-test
??????
̄??????=
??????
√
??????
21
One-sample??????-test NHST
Next, we need to calculate a??????-value for our test statistic, rather than a
??????-value, and compare it to the null (??????-metric) distribution
??????
??????��
one-sample??????-test
??????
??????��=
̄?????? − ??????
??????
̄??????
=
̄?????? − ??????
�
√
??????
Finally, our calculations for effect sizes and confidence intervals are also
slightly altered:
Cohen’s� one-sample??????-test
� =
̄?????? − ??????
??????
Confidence Interval one-sample??????-test
????????????(1 − ??????)% = ̄?????? ± (|??????
��??????�| × ??????
̄??????)
22
One-sample??????-test NHST
Let’s assume we just conducted our??????-test to evaluate whether some new
approach to psychological counseling, such as increased positive
self-communication, resulted in different scores on a measure of anxiety, in
which the population mean was known (or assumed) to be 50, but in which
the population variance was unknown…
APA Write-up
A one-sample t-test was conducted to assess whether increased positive
communication resulted in a different average amount of anxiety. A random
sample of 20 participants (?????? = 43.5,???????????? = 16.25) was not found to
significantly differ from the assumed population (??????(19) = −1.72,
?????? = .107,� = .400,????????????95% = [35.88, 51.12]), although the difference
did account for a medium effect size. No assumptions of the test were
violated.
24
Two sample / One Variable
Scenarios
Dependent samples??????-test Independence vs. Dependence
In actual research, it is much more common to collect two or more sample of
data than it is to conduct one sample tests
For example, perhaps we want to compare different groups, or assess how a
single groupchangesover time
•Comparing different groups:between-subjects design
•E.g., a treatment vs. control group
•E.g., SFU students vs. UBC students
•Comparing one group over time:within-subjects design
•E.g., pretest vs. posttest
•E.g., effectiveness of drug on recovery
Warning:this is not the same as our sampling distribution thought experiment is which taking
multiple samples from a population was described as a theoretical concept
25
Dependent samples??????-test Independence vs. Dependence
In situations where we draw two samples, such as when we are employing
between- or within-subjects research designs, our samples can be either
independentordependent
•Independent samplesare those in which the scores for one group in
no way affect the scores on another group
•Treatment vs. control; SFU vs. UBC
•Dependent samplesare those in which the scores for one sample are
related in some way to the scores for the other sample
•Pretest vs. posttest: thesameparticipants contribute to both samples
26
Dependent samples??????-test Independence vs. Dependence
When we have two samples, we need to combine or distill them into one
“thing” at some point, so that we can conduct a single hypothesis test
•We don’t want to have two test statistics, for example
The way we combine the samples is different for dependent and
independent samples, and so there are two different kinds of??????-test we
conduct depending on the independence of the samples
27
Dependent samples??????-test Differences from??????and one-sample??????
Dependent-samples??????-test compare the same group of people at two time
points to evaluate their change over time, on a single measure
•One group measured at two time points⟶“two-sample” test
•Within-subjects design
28
Dependent samples??????-test Difference Scores
For dependent sample??????-tests, we combine the samplesat the level of the
scoresby calculatingdifferece scores (??????
??????
)for each participant in our
sample
Importantly, because we are combining the two samples into a single set of
difference scoresbeforeconducting any hypothesis, we are able to
effectively conduct a one sample??????-test on those difference scores
29
Dependent samples??????-test Difference Scores
Since dependent tests typically apply to situations where there are two time
points, it’s a good idea to calculate our difference scores by subtracting the
first time point scores from the second time point scores (i.e.,
?????? = ?????? ????????????�2 − ?????? ????????????�1)
•Using this order showschange over time
It is important to be mindful about how you calculate difference scores
because the directionality of your sample mean, test statistic, and statistical
hypothesis can all be affected by the sign (i.e.,±) of the difference scores
30
Dependent samples??????-test Difference Scores
Suppose a sports supplement company has
developed a new kind of workout supplement
that is supposed to help customers gain weight.
To evaluate the effectiveness of their product,
the company obtained a sample of 10
participants and measured their weight before
taking the workout supplement and again after
participants used the supplement for four
months
?????? ????????????�1 ?????? ????????????�2 ??????
????????????
??????
165 173
100 106
203 203
125 140
105 110
102 113
167 165
186 190
156 163
173 170
̄?????? =
??????
??????=
31
Dependent samples??????-test Difference Scores
Notice how the order for the calculation of
difference scores can change the
directionality of the test
Suppose our hypothesis was that the weight
gain supplement would increase weight over
time...
?????? ????????????�1 ?????? ????????????�2 ??????
????????????
??????
165 173 8 -8
100 106 6 -6
203 203 0 0
125 140 15 -15
105 110 5 -5
102 113 11 -11
167 165 -2 2
186 190 4 -4
156 163 7 -7
173 170 -3 3
̄?????? =5.1 -5.1
??????
??????=5.67 5.67
32
Dependent samples??????-test NHST
In terms of our NHST procedure, the dependent samples??????-test is conducted
almost exactly like a one sample??????-test
The only difference is that, because we are conducting the test on the
difference scores, every step of our NHST procedure needs to reference
those difference scores
•We have a sample of difference scores that was drawn from a
population of difference scores⟶ ?????? ∼ ??????(??????
??????, ??????
2
??????
)
•̄??????and??????
??????
are therefore estimates of??????
??????
and??????
2
??????
•Assume normality in thepopulation of difference scores
33
Dependent samples??????-test NHST
Calculations also resemble a one-sample??????-test with the adaptation to
reference the difference scores:
Standard error Dependent Samples
??????̄??????
=
??????
??????
√
??????
??????
??????��
Dependent Samples
??????
??????��=
̄?????? − ??????
??????
??????̄??????
34
Dependent samples??????-test NHST
Calculations also resemble a one-sample??????-test with the adaptation to
reference the difference scores:
Cohen’s� Dependent Samples
� =
̄?????? − ??????
??????
??????
??????
Confidence Interval Dependent Samples
????????????(1 − ??????)% =̄?????? ± (|??????
��??????�| × ??????̄??????
)
35
Dependent samples??????-test NHST
The last difference between a one sample??????-test and a dependent samples
??????-test concerns the null and alternative hypotheses.
•For the one-sample??????-tests, we either know or picked some justifiable
value for??????
•For dependent-samples??????-tests, we almost always set??????
??????= 0
•This is because??????
??????= 0meansno change, which is the scenario we
typically want to test against
•We thus build up a null distribution that reflects no change over time
occurred and test our sample mean of difference scores against that
36
Dependent samples??????-test NHST
APA Write-up
A dependent samples t-test was conducted to determine whether a new
weight gain supplement significantly changed weight over time. The sample
of ten participants showed an increase in average weight after taking the
supplement (??????
�??????????????????= 5.1,???????????? = 5.67) that was statistically significant (
??????(9) = 2.84, ?????? = .020, � = .899, ????????????95% = [1.03, 9.17]) and which
accounted for a large effect size. No assumptions of the test were violated.
38