Week 4: T-Tests and ANOVA Flashcards
What is the purpose of a t-test?
To determine if there is a significant difference between the means of two groups or across time for one group
What is ANOVA used for?
To compare means across more than two groups to determine if at least one group differs significantly
What is the command to compare the sample mean of a variable to a specific population value?
<ttest varname==x>
When do you use a one-sample t-test?
When comparing the sample mean to a known value from the general population
What is the independent t-test used for?
To compare means between two independent groups
What are the assumptions of the independent t-test?
Normally distributed data, random sampling, homogeneity of variance, and a continuous dependent variable
When do you use a paired t-test?
When comparing means from the same group at two time points or under two conditions
What is H0 in a paired t-test?
The mean difference between the paired observations is zero
What does ANOVA test do?
Whether there are significant differences in means among three or more groups on one continuous variable.
What is a post-hoc test in ANOVA?
A follow-up test (e.g., Tukey’s HSD) to identify which groups differ after a significant ANOVA result.
Command: <pwmean dependent_variable, over(independent_variable) mcompare(tukey) effects>
What is the non-parametric equivalent of the independent t-test?
Mann-Whitney U test (also called Mann-Whitney-Wilcoxon test or Wilcoxon rank-sum test)
When is the Kruskal-Wallis test used?
As a non-parametric alternative to one-way ANOVA when data do not meet normality assumptions
How do you test for normality?
Use <swilk> for Shapiro-Wilk test and <sktest> for skewness and kurtosis test</sktest></swilk>
How do you conduct an independent t-test?
<ttest dependent_variable, by(independent variable)>
What command checks homogeneity of variance?
<sdtest variable, by(group)> or <robvar variable, by(group)>
Note: We need to assess if there is enough evidence to reject the H0 of equal variances. The H1 of interest is that the variances in the two groups are not equal (Ha: ratio ! = 1 - if the variances were equal, their ratio would be equal to 1. If p > 0.05, there is evidence to suggest the variances are equal)
How do you perform a one-way ANOVA?
<oneway dependent_variable independent _variable, tabulate>