Week 4: T-Tests and ANOVA Flashcards

1
Q

What is the purpose of a t-test?

A

To determine if there is a significant difference between the means of two groups or across time for one group

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is ANOVA used for?

A

To compare means across more than two groups to determine if at least one group differs significantly

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the command to compare the sample mean of a variable to a specific population value?

A

<ttest varname==x>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

When do you use a one-sample t-test?

A

When comparing the sample mean to a known value from the general population

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the independent t-test used for?

A

To compare means between two independent groups

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What are the assumptions of the independent t-test?

A

Normally distributed data, random sampling, homogeneity of variance, and a continuous dependent variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

When do you use a paired t-test?

A

When comparing means from the same group at two time points or under two conditions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is H0 in a paired t-test?

A

The mean difference between the paired observations is zero

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What does ANOVA test do?

A

Whether there are significant differences in means among three or more groups on one continuous variable.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a post-hoc test in ANOVA?

A

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>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the non-parametric equivalent of the independent t-test?

A

Mann-Whitney U test (also called Mann-Whitney-Wilcoxon test or Wilcoxon rank-sum test)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

When is the Kruskal-Wallis test used?

A

As a non-parametric alternative to one-way ANOVA when data do not meet normality assumptions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How do you test for normality?

A

Use <swilk> for Shapiro-Wilk test and <sktest> for skewness and kurtosis test</sktest></swilk>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How do you conduct an independent t-test?

A

<ttest dependent_variable, by(independent variable)>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What command checks homogeneity of variance?

A

<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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How do you perform a one-way ANOVA?

A

<oneway dependent_variable independent _variable, tabulate>

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is the H0 for comparing means between groups?

A

There is no significant difference in the means between groups

18
Q

Is a hypothesis comparing two groups typically one- or two-tailed?

A

Two-tailed, unless there is a specific directional expectation

19
Q

How do you interpret a p-value in hypothesis testing?

A

A p-value < 0.05 typically indicates significant evidence against H0

20
Q

What does a significant Levene’s test indicate?

A

Variances between groups are not equal

21
Q

What is the alternative if normality assumptions are violated?

A

Use non-parametric tests like Mann-Whitney U or Kruskal-Wallis

22
Q

How do you interpret the 95% CI of a mean executive function score of 17.3 among older English people?

A

Command: <ci>
Output: 95% CI 17.14, 17.50
We can be 95% certain that the true population mean of executive function among older English people is between 17.14 and 17.50.</ci>

23
Q

What is included in the output for a one-sample t-test?

A
  • H0
  • Student t-statistic
  • Df
  • Three alternative hypothesis: The mean is lower than μ; The mean is NOT equal to μ; The mean is greater than μ
  • P-values for each alternative hypothesis
24
Q

How do you a one-sample t-test for a specific sub-group?

A

Example: Executive function among older English people (aged 60+) among those who report no vigorous physical activities
1. Find the mean of executive function among adults aged 60+ <mean>=60 (mean = 16.31)
2. Use the mean in a one-sample t-test to assess whether the mean executive function of those reporting no vigorous physical activities differs significantly from the whole ELSA sample
3. <ttest cfex=16.31 if dhager>=60 & heacta==4></mean>

25
Q

How do you interpret results from the Shapiro-Wilk test?

A

H0 = the variable is normally distributed
If p < 0.05, there is enough evidence against H0 (and the variable is not normally distributed).

26
Q

What is the problem when using formal normality tests on small and large sample sizes?

A

Normality tests have little power to provide against H0 - small samples often pass normality tests. For large sample sizes, significant results would be derived even in the case of a small deviation from normality, although this small deviation wouldn’t affect the results of a parametric test

27
Q

What tools can be used to assess normality?

A

A combination of visual inspection, assessment using skewness and kurtosis, and formal normality tests

28
Q

What do we do when we think data are showing substantial departures from normality?

A

Transform the data (e.g., by taking logarithms) or select a non-parametric method. The non-parametric alternatives have less power and require the two distributions to be more or less the same

29
Q

What’s the difference between <robvar> and <sdtest>?</sdtest></robvar>

A

<robvar> is a more robust when dealing with skewed distributions. The output will show information for three versions of the test: centred at the mean (W0), centred at the median (W50), and centred using a 10% trimmed mean (W10)
</robvar>

30
Q

How do you formally interpret results from an independent samples t-test?

A

Example: An independent samples t-test was conducted to compare the executive function for men and women. Descriptive statistics showed that men (mean = 17.53, sd 4.28) had slightly higher executive function than women (mean = 17.14, sd 4.29). When the t-test was performed, we found some evidence to suggest that the executive function of older people differ by gender [t(df)=2.096, p = 0.0362), with older men having on average higher executive function than women by 0.39 (95% CI 0.02, 0.075).

31
Q

What different ANOVAS can be used?

A

Two-way ANOVA includes two conditions. MANOVA includes more than one dependent variable. There are different types of ANOVA for longitudinal versus cross-sectional analysis.

32
Q

How do you test for equality of variance in one-way ANOVA?

A

Bartlett’s test for equal variances is produced as part of the output. If the test is significant, the variances are not equal across the groups.
If the difference in variances is not large and if your sample sizes are equal, you could still report results from ANOVA. Otherwise, we use the Welch or Brown-Forsythe test statistic as they are more robust (or use the non-parametric alternative, Kruskal-Wallis test)

33
Q

What code produces pairwise comparisons using the Welch test?

A

<ttest dependent_variable if inlist(independent_variable, 1, 2), by(independent_variable) welch>
<ttest dependent_variable if inlist(independent_variable, 1, 3), by(independent_variable) welch>
<ttest dependent_variable if inlist(independent_variable, 2, 3), by(independent_variable) welch>

34
Q

What does the Mann-Whitney U test and Kruskal-Wallis test do?

A

Mann-Whitney U test puts everything in terms of rank rather than in terms of new values. At its basic level, the test ranks everything, sums the ranks, and produces a statistic which tells you whether the two populations likely came from the same underlying population.
The Kruskal-Wallis test uses summed rank scores to determine the results. Informally, it used to test if the distributions have the same median

35
Q

How do you compute a Mann-Whitney U test?

A

<ranksum dependent_variable, by(independent_variable)>
In the output, below the table there is a variance adjustment to account for tied ranks. The values we are interested in are z and Prob > |z|

36
Q

How do you compute a Kruskal-Wallis test?

A

<kwallis dependent_variable, by(independent_variable)>
You should use the “ties” value when two or more observations can have the same score.

37
Q

How do you compute a paired t-test?

A

<ttest var1==var2>
To assess by a category, the command is <bysort cat_var: ttest var1==var2>

38
Q

Does a paired t-test assume homogeneity of variance?

A

No - the variances of the two variables separately are irrelevant.

39
Q

When would use a non-parametric alternative to paired t-test?

A

When two variables are not interval and you assume the difference is ordinal. The non-parametric version is the Wilcoxon signed rank sum test

40
Q

How do you compute a Wilcoxon signed rank sum test?

A

<signrank>
</signrank>

41
Q

How do you formally report one-way ANOVA results?

A
  • A one-way ANOVA was conducted to compare the executive function scores by five different groups of self-rated health. Descriptive statistics show that those in excellent health report higher scores (mean=19.4, sd=4.06), compared to those who reported their health as poor (mean=15.6, sd=4.29). When we tested these differences using ANOVA, we found some strong evidence to suggest differences in mean executive function scores by self-rated health [F(4,1081)=21.54, p < 0.001].
  • Post-hoc comparisons using Tukey’s HSD indicated that mean executive function of those in excellent health was significantly higher than respondents who reported their health as very good or less, with an average higher score of 1.19 compared to respondents in “very good health” and of 3.79 compared to those in “poor health”
  • Overall, there was a significant difference in mean executive function by self-rated health such that older people with better health had higher scores than those in poorer health.