Interaction analyses — Power (part 1)

  • This post: How to do a power analysis for an interaction in a linear regression (in R), and what factors effect how much power you have.
  • Part 2: Interpreting the effect-size of an interaction, by connecting it to simple-slopes.
  • Part 3: Determining what sample size is needed for an interaction.

First, some real data

Call:lm(formula = Stress ~ age + gender + White + Suburban + College + Heterosexual + familysize + Anx + N + Anx:N + (Anx + N):(age gender + White + Suburban + College + Heterosexual +familysize),
data = DASS4)
Estimate Std. Error t value Pr(>|t|)
(Intercept) 0.0373975 0.0169867 2.202 0.02783 *
Anx:N 0.0873982 0.0162109 5.391 7.99e-08 ***
Anx 0.5802001 0.0184820 31.393 < 2e-16 ***
N -0.3293825 0.0187527 -17.565 < 2e-16 ***
age 0.0485193 0.0156328 3.104 0.00194 **
gender -0.0101972 0.0152473 -0.669 0.50372
White 0.0004681 0.0149604 0.031 0.97504
Suburban -0.0268078 0.0148041 -1.811 0.07034 .
College -0.0115615 0.0153877 -0.751 0.45255
Heterosexual 0.0163745 0.0148892 1.100 0.27160
familysize -0.0099285 0.0148598 -0.668 0.50413
age:Anx 0.0189089 0.0185720 1.018 0.30876
gender:Anx -0.0015383 0.0183065 -0.084 0.93304
White:Anx -0.0249086 0.0173450 -1.436 0.15117
Suburban:Anx -0.0146885 0.0175529 -0.837 0.40282
College:Anx -0.0029976 0.0182831 -0.164 0.86979
Heterosexual:Anx -0.0095487 0.0165095 -0.578 0.56309
familysize:Anx -0.0022462 0.0179375 -0.125 0.90036
age:N 0.0216759 0.0180634 1.200 0.23031
gender:N -0.0108077 0.0174722 -0.619 0.53629
White:N -0.0087409 0.0173806 -0.503 0.61509
Suburban:N 0.0276818 0.0173809 1.593 0.11143
College:N 0.0163651 0.0179572 0.911 0.36225
Heterosexual:N -0.0043325 0.0176113 -0.246 0.80571
familysize:N -0.0071348 0.0184509 -0.387 0.69903
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

A power analysis

pwr.r.test(r = 0.087,power = 0.8,sig.level = 0.05)
approximate correlation power calculation (arctangh transformation)
n = 1033.84
r = 0.087
sig.level = 0.05
power = 0.8
alternative = two.sided

Effects of interacting-variable effect size and correlation

Final thoughts and next steps

--

--

--

PhD in Neuroscience, Postdoc at U Pittsburgh. https://twitter.com/david_baranger

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Top 3 Pandas Functions You Didn’t Know Existed

I want standardised performance indicators!

How to Train a Classification Model with TensorFlow in 10 Minutes

Day 8: Intro to Unsupervised Learning

Everything to Know About Convolutional Neural Networks

Convolutional Neural Networks

CRISP-DM Phase 1: Business Understanding

SFPD Crime Data Analysis — PySpark DataFrames

Ranking and Selection of the best with Multi-Criteria Decision Making (MCDM) — Part Two

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
David Baranger

David Baranger

PhD in Neuroscience, Postdoc at U Pittsburgh. https://twitter.com/david_baranger

More from Medium

Statistics for Data Scientists (Part I)

Inferential Statistics: Basic Hypothesis Testing

Interpreting Different Regression Models

Covariance, correlation and R-squared