The first hypothesis test that we will learn, allows us to compare the mean of a
sample, to the mean from a population. We do this using a one sample t-test in JASP.
The one sample t-test is a parametric procedure, meaning that we
will assume that what we learn from our sample, is also true of the population
from which our sample was drawn. When we have a sample of scores, the one sample
t-test tests whether our sample mean is statistically significantly different
than a population mean (or another known value). Previously, we imagined a
population of polar bears that walk an average of 100 miles per week.
As is usually the case, we did not know the standard deviation of the population (sigma).
Usually this occurs because we have not actually measured the entire
population. When we want to compare a sample to this known population value,
for example, a sample of polar bears who consumed caffeine and walk an average of
150 miles per week, with a standard deviation of 9, we use the one-sample
t-test to help us make a fair comparison between the sample and its population.
For this hypothetical example, we have read a journal article in Martha Stewart
Correctional Quarterly, reporting that the average national score for women on
a test of indoor gardening is "73", but there is no standard deviation reported.
We want to know how men will score on the same test. We randomly select
9 men, and we compare their sample mean of 66.56 to the population mean for women,
which we have already established is 73. We start with a null hypothesis that our
sample of men has been pulled from a population
of men who have the same mean as the women: again, 73. We assume that there is
no difference between men and women on this test. We write that null hypothesis
as H0 : mu = 73. (Now, this is the same example as when we calculated a
t-test by hand in class.) In Excel, I have opened the data from the MarthaStewart.csv
data set, that we are going to import. We can see that the variable name
is MEN, and that we have 9 scores, one for each of the 9 men who
participated in this test. If you do not have this data set, stop the video now
and enter the data that you see here. Save the data file to your desktop.
Once you have JASP open on your computer, we will open the data by going
to our main menu icon Open -> Computer -> Desktop... locate the MarthaStewart.csv
data set and click Open. JASP will read the file and show you the data. We can
see that JASP thinks that our data are ordinal, but we
intend for them to be Scale data, because they are measuring the number of correct
responses. We want to change the column type. Note that if you click on the name
of the variable, you will be able to change the label - not what we want to do
with this variable - instead, click on the icon next to the variable name to change
the column type. Now we are ready to do our one sample t-test in JASP.
But first, let's walk through the five steps of hypothesis testing so that we know
what we are doing with this test. Step 1: select the appropriate statistic.
The appropriate statistic for comparing a sample mean to a known population value
when the population standard deviation is unknown is the one sample t-test.
Step 2: State the null and alternative hypothesis
We want to know if the mean for men is DIFFERENT than the known mean
for women, so this is a non-directional (or two-tailed) test. (The null and the
alternative hypotheses are going to be exactly the same as when we did this
test by hand.) The null hypothesis is H0: mu = 73. This means that
the sample of men is drawn from a population whose mean is 73.
The alternative hypothesis is H1: mu does not equal 73. Step 3: Select a level
of significance. For selecting our level of significance, we will be using a
two-tailed test, because we are not establishing a
direction that the dependent variable will change. For most research, the level
of significance will be alpha = 0.05. Technically, you could set that
alpha level to any value that your heart desired,
but for scientific research, you really only have two choices: alpha of 0.05 and
alpha of 0.01. Unless the problem says otherwise, assume that the value is
alpha = .05, two-tailed test. The degrees of freedom always equals n - 1,
where n is the number of participants in your sample. In this case, with nine
men, we have eight degrees of freedom. To find the critical value, we go to
Student's t-distribution table. We are using a two-tailed test, so we will focus
on the columns on the left. The Alpha level is .05, with eight
degrees of freedom, so our critical value is positive negative 2.306.
Alternatively, you can download the "Research by Design Effect Size
Calculator for t-Tests" and use it to determine your critical value. Here you
see the six things that you can do with this effect size calculator.
Click on the green tab for critical values. In the upper left we have the
setup for a typical alpha = 0.05, two-tailed test. Simply enter your
degrees of freedom, click (or hit return) and your critical value (2.306)
appears right here... but wait, there's more! If you are not doing the
typical two-tailed alpha of 0.05 test, enter your degrees of freedom here, click,
and you get critical values for both one- and two-tailed tests at a variety of
common alpha levels. You can also customize the settings in
this original box.
So any t-values exceeding 2.306 indicate that the mean of the sample of
Men is statistically significantly different than the population value for women.
Step 4: Calculate the statistics. For this, let's
go back to JASP. We conduct a one sample t-test on these data by clicking
on T-Tests -> One sample t-test. In the Results pane, we already see the table
where the T test results are going to appear. The only variable that we have is MEN.
Move MEN into the variables pane. Because JASP uses dynamic updating, we
already see the results of our t-test in the Results pane; however, these results
are not correct, because there is something very important that we have to
do, first! We MUST tell JASP what is our comparison test value. By default,
JASP compares our sample mean to a population mean of zero. We see that in
this box, labeled Test Value. In our study however, we established that the
comparison mean - the mean for women - is 73. I say that this is very important
because if you do not enter a number for the test value, then the comparison value
will be 0, and if you use a comparison value of 0 when you should be
comparing to 73, you WILL get the wrong answer. Enter 73 into the test value.
Now think about your null hypothesis. We are saying that this sample of men is drawn
from a population that - like women - has a mean of 73. Let's examine some of the
other settings. We have some options for our alternative hypothesis. We are doing
a two-tailed test, which means that our alternative hypothesis is that the
sample mean is "different than" our comparison test value of 73, or that it
is not equal to 73, but we could do a one-tailed test to determine
if our sample mean is significantly "higher than" or "lower than" a given test
value. Another important thing to do is to test the assumptions of our data:
in this case, the assumption of normality. When we click this option, we get a
Shapiro Wilk test, and I'll explain this in a moment. Under Additional Statistics,
select Location parameter, and with it the Confidence Interval. Select the
Effect Size and the Descriptive Statistics. We can also get a plot of the
descriptive statistics here. Let's look at our Results more closely.
In the Results pane we should begin by checking the assumption of normality with our
Shapiro Wilk test. We will discuss assumptions more deeply in a future
lecture, but for now, know that we prefer that our assumption check tests be
non-significant. Think of it like this: the test ASSUMES that our data are a
certain way. When an assumptions test is non-significant, that means that our data
are not significantly different than the test assumes that they are. This is what
we want. Ee prefer non-significant assumptions
tests. The p-value of .600 for this normality check - which is not anywhere
close to being < .05 - tells us that the men's scores are not
significantly different in their normality than the t-test assumes that
they are. Basically, the men's scores are close to being normally distributed,
therefore, the assumption is not violated. Good news! But what would we do if this
test showed a significant difference? If the assumption of normality was violated,
we would go back to our settings and we would choose Wilcoxon Signed-Rank test,
which tests against the population median score, rather than the mean, and we
would uncheck Student's t-Test. Now this would, of course, require
knowing the median value of the women's scores in order to do it right. Now that
our test assumptions have been met, we can interpret the t-test, itself. We see a
box labeled Descriptives. In this box, we see the sample size, the mean, and the
standard deviation, and the standard error of the mean. We will use all of
these later for our APA-style write up. The results for the t-test itself are in
the box labeled "One Sample T-Test". The t-test value is -3.232.
In this case, the negative value for t means that our sample mean
is "less than" our comparison value of 73. You interpret a positive t-value and a
negative t-value in exactly the same way. The sign for the t-test only indicates
whether your sample mean was larger or smaller than the comparison value.
In the APA style write-up, you could ignore this negative sign, if you want.
The t = -3.232 exceeds (or is larger than) the critical
value of positive or negative 2.306. Degrees of freedom is 8.
We can also see that this significance value for the test is .012,
which is less than .05. We also see that the
95% confidence interval for the difference between sample means (which is mean 1 - mean 2)
shows a lower bound of -11.04 and an
upper bound of -1.847. Because this confidence
interval does not cross 0, it does not include the null hypothesis value of
zero difference, then the groups are different. All three of these findings
tell us exactly the same thing: there is a statistically significant difference
between these two means. We see this same result with our descriptive
plot. Our comparison value is 73. That is the dotted line. Our mean is the dot and
our confidence interval is the bar. Notice how no part of the confidence
interval crosses the dotted line? This is a useful confirmation, but I would not
actually include this plot in my write-up. The last thing that we need is
Cohen's d effect size. For our one sample t-test, the effect size is a -1.08.
We interpret a negative effect size exactly the same way that we
interpret a positive effect size. The negative sign just tells us that the
sample mean was lower than the population mean. If the sample mean was
larger than the population mean, this effect size would have been a positive 1.08.
Regardless, the actual effect was still the same size.
Let's go back to our five steps of hypothesis testing. Step 4: Calculate
the statistics. The t-test value is -3.232.
We will round that to -3.23. The critical value was
positive or negative 2.306. The obtained t-value exceeds
the critical value. This means that the t-test IS significant, and the sample
mean differs statistically significantly from the population mean. We reject the
null hypothesis that says there is no difference between the sample and the
population. Finally, Step 5: Make the decision. Men (with their mean
and standard deviation) scored significantly lower than women (with
their mean). We do not have a standard deviation for the population on a test
of indoor gardening... and then the write-up for the t-test: T with 8 degrees
of freedom equals -3.23, probability equals .012.
And here is how we would write up these results in APA style.
Notice that the t, the p, and Cohen's d are all italicized, and the
degrees of freedom (8) is in parentheses. I changed the color of the p-value to
stress the difference between the write up by hand that used p < 0.05
and this write up for JASP, which reports the actual probability. The last
statement about gender difference would go in your Discussion section, if you are
writing this up for a paper.