PSY 348: Lecture 8
Farmingdale State College
Descriptive Statistics
Inferential Statistics
Professor Brocker still wants to know how much adults in the US enjoy the Netflix Original, Dark. He has unlimited funds to study this very important research question. He hires 30 students to collect the data. Each student has to collect 500 responses to the following question:
On a scale of 1 (I hate it with my entire being) to 10 (I believe in my soul that Dark is the best show ever made), how much do you enjoy Dark?
Each student asks 500 people how much they enjoy the Netflix Original Dark.
How many people did the class ask in total?
set.seed(348)
# 30 students each rate 500 people on the 1-10 scale
replicate(30, mean(pmin(pmax(round(rnorm(500, 6.6, 1.5)), 1), 10))) |>
(\(m) tibble(Sample = paste0("S", 1:30), `Sample Mean` = m))() |>
gt() |>
fmt_number(columns = `Sample Mean`, decimals = 3) |>
tab_options(table.width = pct(60), table.font.size = 22) |>
opt_row_striping() |>
opt_interactive(page_size_default = 8)\(\bar{x}_1 = \dfrac{x_1 + x_2 + x_3 + \cdots + x_{500}}{500}\)
One mean per sample: \(\bar{x}_1, \bar{x}_2, \ldots, \bar{x}_{30}\).
Each point on this curve is one person’s rating.
We could calculate the mean of the sample means.
We could calculate the standard deviation of the sample means.
With 30 samples we only get an approximation. To get the exact answer, we would need every possible sample of 500 people, and that is theoretical.
Both curves are centered on \(\mu = 6.6\). The top curve is a distribution of people. The bottom curve is a distribution of sample means, so it is much narrower.
Each value in this distribution no longer represents one person.
Each value represents the mean of one sample of 500 people.
\(\sigma = 1.5\) in every case; only \(n\) changes.
0.21
\(n = 50\)
0.07
\(n = 500\)
0.02
\(n = 5{,}000\)
\(\sigma\) describes how spread out individual scores are.
\(SE\) describes how spread out sample means are.
Sample mean \(\bar{x}\) (written \(M\) in APA-style papers) and sample SD \(s\) describe a sample.
\(\mu\) (pronounced “mew”) is the population mean.
\(\sigma\) is the population standard deviation.
\(SE\) is the standard deviation of the sample means.
| Term | Symbol | Formula |
|---|---|---|
| Sample Mean | \[\bar{x}\] or \[M\] | \[\frac{\sum x_i}{n}\] |
| Sample SD | \[s\] | \[\sqrt{\frac{\sum (x_i - \bar{x})^2}{n-1}}\] |
| Population Mean | \[\mu\] | \[\frac{\sum X_i}{N}\] |
| Population SD | \[\sigma\] | \[\sqrt{\frac{\sum (X_i - \mu)^2}{N}}\] |
| Standard Error | \[SE\] | \[\frac{\sigma}{\sqrt{n}}\] |
Convert to z first
One student’s sample of \(n = 500\) has \(M = 6.75\). If \(\mu = 6.6\) and \(\sigma = 1.5\), how unusual is a sample mean this high?
| z | .03 | .04 | .05 |
|---|---|---|---|
| 2.1 | 0.9834 | 0.9838 | 0.9842 |
| 2.2 | 0.9871 | 0.9875 | 0.9878 |
| 2.3 | 0.9901 | 0.9904 | 0.9906 |
Find 2.2 on the left side of the table and the .04 column.
The table gives the area to the left: \(.9875\).
We want 6.75 or more, so subtract from 1.
We want to know how much people like pizza.
There are 12,500 people in our population. Each of the 25 of us collects a sample of 500.
\(500 \times 25 = 12{,}500\)
Each of us calculates the mean response from our sample of 500 people.
What do we call those means?
I randomly choose one mean from our distribution of sample means about how much people like pizza.
What is the probability of picking a mean with a z-score of -1 or less?
Sampling theory is the body of principles that tells us how statistics from samples behave, so that we can make inferences about the population the samples came from.
Take every possible sample of size \(n\) from a population and compute the mean of each. Those means form the sampling distribution of the mean.
It is conceptual and theoretical. We never actually collect every possible sample.
The sampling distribution of the mean is centered on \(\mu\), has standard deviation \(SE = \sigma / \sqrt{n}\), and is approximately normal for large \(n\).
That lets us find the probability of getting a particular sample mean.
We will use that probability to gauge significance in our inferential statistics.
A hypothesis is a testable prediction of what will happen in our experiment that:
Names the variables (independent and dependent)
Clearly contrasts the groups
Null Hypothesis \(H_0\)
Alternative Hypothesis \(H_1/H_A\)
In every case \(H_0: \mu_1 = \mu_2\). The shaded rejection region holds the most extreme 5% of sample outcomes under the null (\(\alpha = .05\)): z beyond \(\pm 1.645\) in one tail, or beyond \(\pm 1.96\) split across two.
Every year we run a huge campus climate survey. We can’t ask all 10,000 students, so we draw a sample. Now imagine each of you is in charge of your own survey, each collecting 400 students’ responses.
FSC has 10,000 students.
Asking all 10,000 is not practical.
Each of the 25 of us collects a sample of 400 students.
We calculate the average belonging score in each sample.
If we plot all 25 sample means from FSC:
Most cluster near the true population mean (the dashed line).
Some fall higher or lower by chance.
With more samples, this plot approaches the sampling distribution of the mean.
With larger samples (bigger \(n\)), the sampling distribution becomes narrower.
We want to compare FSC students’ sense of belonging to that at another college. We draw 25 samples of 400 at each school.
We repeat the study at John Jacob Jinglehymer Smith University (JJJSMU).
We now have two sampling distributions:
One for FSC
One for JJJSMU
Same two schools, same data. The individual distributions overlap heavily. The sampling distributions of the mean overlap far less, because \(SE = \sigma/\sqrt{n}\) is much smaller than \(\sigma\).
Estimate population parameters.
Quantify sampling error.
Compare populations in a statistically rigorous way.
A lady declares that by tasting a cup of tea made with milk she can discriminate whether the milk or the tea infusion was first added to the cup. We will consider the problem of designing an experiment by means of which this assertion can be tested. […] [It] consists in mixing eight cups of tea, four in one way and four in the other, and presenting them to the subject for judgment in a random order. The subject has been told in advance of that the test will consist, namely, that she will be asked to taste eight cups, that these shall be four of each kind […]. — Fisher, 1935.
A lady claimed she could tell whether milk or tea was poured first.
Fisher designed an experiment:
The lady must classify each cup.
A classic example of hypothesis testing, based on R.A. Fisher’s 1935 design.
Null hypothesis \(H_0\)
The lady has no special ability; she is just guessing.
Alternative hypothesis \(H_1/H_A\)
The lady can tell the difference.
Key idea: we begin by assuming \(H_0\) is true.
We only reject \(H_0\) if the data are too surprising under \(H_0\).
For 8 cups (4 of each), under \(H_0\) the number correct can only be 0, 2, 4, 6, or 8.
Reject \(H_0\) only if she gets all 8 correct.
Under \(H_0\) there are \({8 \choose 4} = 70\) equally likely ways to guess which 4 cups are milk-first.
So the probability of guessing all 8 correctly by chance is \(\dfrac{1}{70} \approx 1.4\%\).
Since \(1.4\%\) is less than \(5\%\), it is rare enough to count as evidence against \(H_0\).
\[{n \choose k} = \dfrac{n!}{k!\,(n-k)!}\]
8 of 8 correct: reject \(H_0\)
If she were just guessing, a result this extreme happens about 1.4% of the time. That is evidence she can tell the difference.
6 of 8 correct: fail to reject \(H_0\)
If she were just guessing, getting 6 or more right happens about \(\frac{1 + 16}{70} = 24.3\%\) of the time. That is not unusual enough.
We never prove the alternative; we only judge whether the data are too unlikely under the null.
[1] 0.01428571 0.22857143 0.51428571 0.22857143 0.01428571
[1] 0.01428571
Professor Brocker wants to know if Millennials enjoy the Netflix Original Dark more than Gen Z does. He recruits 500 Millennials and 500 Gen Z students and asks them to rate Dark on a scale of 1 to 10 (10 being fantastic). Participants are not randomly assigned to generation, so this is a quasi-experiment.
Null hypothesis: the mean rating is the same for both generations.
Alternative hypothesis: the mean rating is higher for Millennials.
Some texts write the null for a directional test as \(\mu_{\text{Millennial}} \leq \mu_{\text{Gen Z}}\). The decision rule is the same.
Professor Brocker wants to know if giving his students coffee will improve their exam scores. He randomly assigns
13of his26students to drink a doubleshot; he calls this the experimental group. The other13students drink decaf (a placebo); he calls this the control group.
\(H_0\): \(\mu_\text{Coffee} = \mu_\text{Decaf}\)
\(H_1/H_A\): \(\mu_\text{Coffee} > \mu_\text{Decaf}\)
Esmeralda gives an anti-depressant to
100individuals suffering from depression. She gives another100individuals a placebo. After2months, we measure their depression.
\(H_0\): \(\mu_\text{SSRI} = \mu_\text{Placebo}\)
\(H_1/H_A\): \(\mu_\text{SSRI} < \mu_\text{Placebo}\)
Jonas assigns half of the participants to engage in aerobic exercise for one hour a day for 6 months. The other half of the participants do not exercise for 6 months. At the end of the 6 months, Jonas measures the participants’ working memory capacity.
\(H_0\): \(\mu_\text{Exercise} = \mu_\text{No Exercise}\)
\(H_1/H_A\): \(\mu_\text{Exercise} > \mu_\text{No Exercise}\)
In science, we do not say that we proved anything. Our decision is stated in terms of the null hypothesis \(H_0\).
The decision depends on the p-value: the probability of getting data at least this extreme if \(H_0\) were true.
Reject \(H_0\) (\(p \leq \alpha\))
The data would be unlikely if \(H_0\) were true. The data are consistent with \(H_A\), but that is not a proof of \(H_A\).
Fail to reject \(H_0\) (\(p > \alpha\))
The data are not unlikely enough under \(H_0\). This is not evidence that \(H_0\) is true. A small sample or a noisy measure can hide a real effect.
Rejecting \(H_0\) is the result we usually hope to see, but a well-run study that fails to reject is still informative.
Failing to reject means “we did not find convincing evidence of a difference,” not “there is no difference.”
When reporting a result, state the decision about \(H_0\) and give the test statistic and p-value.
Jonas assigns half of the participants to engage in aerobic exercise for one hour a day,
5days a week, for6months. The other half of the participants do not exercise for6months. At the end of the6months, Jonas measures the participants’ working memory capacity. His test is not significant.
State Jonas’ findings in terms of the null hypothesis:
Brendan assigns half of the participants to view a picture of a face on a mortuary table (control condition). The other half of the participants view an image of their own face made to look dead using a filter (experimental condition). Brendan then measures all participants’ anxiety about dying and runs a t-test, which is statistically significant.
State Brendan’s findings in terms of the null hypothesis:
Sampling Theory | ⬡⬢⬡⬢⬡⬢