Podcast
Questions and Answers
In what situations would a paired-samples t-test be more appropriate than an independent samples t-test?
In what situations would a paired-samples t-test be more appropriate than an independent samples t-test?
A paired-samples t-test is more appropriate when you have two scores from each person or matched pair, and want to test the null hypothesis that the two scores have the same mean.
What is Cohen's d, and how does it relate to the t-test?
What is Cohen's d, and how does it relate to the t-test?
Cohen's d is a measure of effect size for the t-test, calculated by dividing the difference between the means of two groups by an estimate of the standard deviation. It quantifies the size of the difference between two groups in terms of standard deviations.
Explain the difference between the Student's t-test and Welch's t-test.
Explain the difference between the Student's t-test and Welch's t-test.
The Student's t-test assumes that the two groups being compared have equal variances, while Welch's t-test does not and is used when this assumption is violated. Welch's t-test adjusts the degrees of freedom to account for the unequal variances.
What is the purpose of a QQ plot, and how does it help in assessing the validity of the t-test?
What is the purpose of a QQ plot, and how does it help in assessing the validity of the t-test?
Name the three assumptions of Student's t-test, as per the text.
Name the three assumptions of Student's t-test, as per the text.
Flashcards
What is a t-test?
What is a t-test?
Compares the means of two groups to determine if there's a statistically significant difference.
What is H₀ (Null Hypothesis)?
What is H₀ (Null Hypothesis)?
The true population mean for psychology student grades is 67.5%.
What is H₁ (Alternative Hypothesis)?
What is H₁ (Alternative Hypothesis)?
The population mean isn't 67.5%.
What is a z-score?
What is a z-score?
Signup and view all the flashcards
What does a z-test assume about the population standard deviation?
What does a z-test assume about the population standard deviation?
Signup and view all the flashcards
Study Notes
Comparing Two Means
- Utilizes a t-test to compare two groups means where the outcome variable is interval scale or higher, and the predictor is binary.
T-Tests
- There are different types of t-tests depending on the question:
- One-sample t-tests (Section 13.2)
- Independent samples t-tests (Sections 13.3 and 13.4)
- Paired samples t-tests (Section 13.5)
- Cohen’s d measures effect size for a t-test (Section 13.8)
- Assumptions of t-tests and remedies will be focused on in later chapter
One-Sample Z-Test
- A one-sample z-test is rarely used but serves as a stepping stone to the t-test.
Inference Problem Addressed by the Z-Test
- Dr. Zeppo grades intro stats on a curve with an average of 67.5 and a standard deviation of 9.5.
- The grades of 20 students also taking psychology are collected to determine if they score differently.
- The sample mean for the psychology students grades X̄ = 72.3.
- Assess whether the population mean µ for psychology student grades is 67.5.
Constructing the Hypothesis Test
- Null hypothesis (H0): population mean µ for psychology student grades is 67.5.
- Alternative hypothesis (H1): the population mean is not 67.5.
- Psychology grades are normally distributed.
- The true standard deviation of the scores σ is known to be 9.5.
- The difference between the sample mean X̄ and the population mean µ₀ will be the main diagnostic test statistic.
- Compare sample mean X̄ to the population mean, so calculate X̄ - µ0.
- If the quantity is close to 0, it favors the null hypothesis but if it is far away from 0, it is less likely retain
- In this scenario, X ~ Normal(µ₀, σ2).
Sampling Distribution
- The sampling distribution of the mean X̄ is also normal with a mean µ.
- The standard deviation of the sampling distribution, called the standard error of the mean SE(X̄), is σ/√N.
- If the null hypothesis is true: X̄ ~ Normal(µ₀, SE(X̄)).
Standardization
- Convert X̄ into a standard score zX̄ = (X̄ - µ0) / SE(X̄).
- The test statistic is the z-score zX̄.
- Like all z-scores, it has a standard normal distribution: zX̄ ~ Normal(0, 1).
- The z-statistic indicates how many standard errors X̄ is from µ0.
- Rejection regions for the z-test are always the same, as illustrated in Figure 13.3
Z Table
- In the days where calculations were done by hand, someone could publish a table like this:
- Desired α level, Two-sided test, One-sided test
- 0.1,. 1.644854, 1.281552
- 0.05, 1.959964, 1.644854
- 0.01, 2.575829, 2.326348
- 0.001, 3.290527, 3.090232
- The desired α level determined the critical Z value
Worked Example with Grades Data
-
Calculate sample mean
sample.mean <- mean(grades)
sample.mean
= 72.3
-
Create mu.null variable for null hypothesis population mean
mu.null <- 67.5
-
Create sd.true corresponding to known standard deviation
sd.true <- 9.5
-
Create N variable for sample size using the function
length()
N <- length(grades)
N
= 20
-
Now the (true) standard error:
sem.true <- sd.true / sqrt(N)
sem.true
= 2.124265
-
Now find the zscore
z.score <- (sample.mean - mu.null) / sem.true
z.score
= 2.259606
-
Since 2.26 is bigger then 1.96, but smaller than 2.58 we can say there is a significant effect here, which we would write up like said:
- "With a mean grade of 73.2 in the sample of psychology students, and assuming a true population standard deviation of 9.5, we can conclude that the psychology students have significantly different statistics scores to the class average (z = 2.26, N = 20, p < .05)."
-
Can get p-value using the
pnorm()
function, which gets the area under the curve below or above specified numbers-
For upper tail:
upper.area <- pnorm( q = z.score, lower.tail = FALSE )
upper.area
= 0.01192287
-
For lower tail:
lower.area <- pnorm( q = -z.score, lower.tail = TRUE )
lower.area
= 0.01192287
-
The p-value becomes
p.value
=upper.area
+lower.area
p.value
= 0.02384574
-
Z-Test Assumptions
- Normality: population distribution is normal.
- Independence: observations in the data set aren't correlated.
- Known Standard Deviation: the true standard deviation of the population is known.
- Because of the unrealistic nature of the 3rd assumption, we can use the t-test
One-Sample T-Test
-
Since its not safe to assume psychology students have the same standard deviation as other students, we cannot assume that i know the true value of σ
-
Use
sd(grades)
as a substitute -
However, since we are now relying on an estimate, we must be careful about our new estimate
-
To accommodate to fact that we arent completely sure what the true standard deviation is, we use the ttest
-
We will refer to the test statistic as a t-statistic
-
The t-statistic uses same formula
- t= (X̄ - μ) / (ô/√N)
Distribution
- The sampling distribution turns into a t-distribution with df = N-1
- A t-distribution is very similar to a normal distribution, but has "heavier" tails
- For large N, the two distributions are identical
The T.Test() Function
-
The function is very versatile
-
Needs the the 1sr package
-
The code to run the test is
- oneSampleTTest(x=grades, mu=67.5)
Output Explanation
- There are many descriptive statistics
- There are specified hypotheses
- Test results show the t-statistic, df, p-value as well as confidence, and Cohens D
Assumptions
- The T-Test makes the following assumptions:
- Normality - the data is assumed to have a normal distribution
- Independence - The observations in the sample are generated independently of one another
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.