4.13. Extra Practice#

This is meant to help you practise the same core skills you developed in the previous exercises. Completing these exercises are optional and only meant to provide a little extra practice if you want.

4.13.1. Set up Python Libraries#

As usual you will need to run this code block to import the relevant Python libraries

# Set-up Python libraries - you need to run this but you don't need to change it
import numpy as np
import matplotlib.pyplot as plt
import scipy.stats as stats
import pandas as pd
import seaborn as sns
sns.set_theme(style='white')
import statsmodels.api as sm
import statsmodels.formula.api as smf

4.13.2. 1. Effect size for correlation#

The researcher computes Pearson’s correlation coefficient between sleep duration (hours) and memory score and obtains:

\(r\) = 0.22

a) Interpreting effect size#

  • What does a correlation of \(r = 0.22\) tell us about the strength of the relationship?

  • Would you describe this as a small, medium, or large effect?

  • What does this value of \(r\) imply about the amount of overlap between high- and low-performing participants?

Your Answer Here

4.13.3. 2. Effect size \(\neq\) statistical significance#

The correlation is tested at the \(\alpha = 0.05\) level using a one-tailed test (the researcher predicts that more sleep is associated with better memory).

b) Sample size and significance#

  • Explain why a correlation of \(r = 0.22\) might be statistically significant in a large sample, but not in a small sample.

  • What does statistical significance tell us?

Your Answer Here

4.13.4. 3. Power and sample size#

The researcher now wants to consider whether the study was adequately powered.

c) Post hoc power#

  • Using \(r = 0.22\) as the effect size and \(n = 60\), what is the power?

  • Briefly explain why post hoc power analyses are not the ideal use of power analysis.

#Your Code Here

4.13.5. 4. A priori power analysis#

The researcher plans a follow-up study and wants to ensure adequate power.

d) Planning a new study#

How many participants would you suggest the researcher plans to collect assuming 80% power?

#Your code here

4.13.6. 5. Effect size and variance#

Now consider a different study.

A sports scientist compares reaction times (ms) between two groups:

  • athletes who slept at least 8 hours;

  • athletes who slept less than 6 hours.

The difference in mean reaction time between groups is 20 ms.

e) Effect size intuition#

  • Explain why a 20 ms difference could be a large effect in one study but a small effect in another.

  • What role does within-group variability play in determining effect size?

Your Answer here

4.13.7. 6. New Years Resolutions#

A researcher investigates whether making a New Year’s resolution leads to an increase in exercise behaviour.

Participants report the average number of minutes they spend exercising per week at two time points:

  • December, before the New Year

  • January, after the New Year

Exercise time is measured in minutes per week, with higher values indicating more exercise.

Load the data below and determine if the study was properly powered

#Your Code Here