MSDB 720 Lecture 3 part 2: Main Effects and Interaction Models in Computational Sciences
Definition and Context of Main Effects
Main Effect Definition: The main effect is the effect of an independent variable on a dependent variable, calculated by averaging across the levels of all other independent variables in the study.
Usage Context: This term is frequently employed within the context of factorial designs and regression models. Its primary purpose is to distinguish single-variable effects from interaction effects within a factorial design framework.
Main Effects with One Categorical Variable
Graphical Representation (Horizontal Line): If a line representing the factor levels is horizontal (parallel to the x-axis), then no main effect exists. This signifies that the response mean remains identical across all levels of the factor.
Graphical Representation (Non-Horizontal Line): If the line is not horizontal, a main effect exists. In this case, the response mean varies across factor levels.
Magnitude: The slope of the line determines the magnitude of the main effect.
Statistical Significance: While graphical plots provide visual evidence of a main effect, it is mandatory to perform formal statistical tests to evaluate whether the observed effect is statistically significant.
Example: Impact of Teacher Expectations and Student Age on IQ Scores
Study Data (Raw Mean IQ Scores):
Teacher Expectations | Student Age: 7 years | Student Age: 15 years |
|---|---|---|
High | ||
Normal |
Calculating the Main Effect of Teacher Expectations:
To find the main effect for the expectation level, average the scores across the age categories.
Average for High Expectations:
Average for Normal Expectations:
Calculating the Main Effect of Student Age:
To find the main effect for student age, average the scores across the expectation levels.
Average for 7-year-olds:
Average for 15-year-olds:
Understanding Interactions
Core Definition: An interaction occurs when the independent variable has a different effect on the outcome (dependent variable) depending on the specific value or level of another independent variable.
Interaction between a Continuous and Categorical Variable:
Scenario: Studying the amount of cholesterol lowering () based on drug dose (continuous) and sex (categorical: Male vs. Female).
Model without Interaction:
Graphically, this is represented by two parallel lines for Males and Females. The effect of the dose is the same for both groups.
Model with Interaction:
Graphically, the lines for Males and Females are not parallel. They may diverge or converge, indicating that the drug's effectiveness depends on the sex of the individual.
Interactions between Two Continuous Variables
Mathematical Model:
Variable Effects:
When an interaction term is present, the effect of one variable that forms the interaction depends on the level of the other variable.
Effect of Dose: For a fixed value of age (e.g., ), the effect of the dose on is given by the derivative/slope: .
Effect of Age: For a fixed value of dose (e.g., ), the effect of age on is given by: .
Dichotomization for Visualization: Continuous variables like age are sometimes split into categories (e.g., "Young," "Middle," "Old") to visualize how the slope of the drug dose changes across different life stages.
Interactions between Two Categorical Variables
Example Scenario: Testing two medications (Med A and Med B) across two sexes (Male and Female).
Coding Example:
Med A = , Med B =
Male = , Female =
The interaction would measure if Med B is more effective for Females than for Males, relative to Med A.
Procedural Steps for Data Analysis with Interactions
Data Preparation: Enter data and create new variables to represent all interactions. This includes all possible two-by-two interaction terms and the single interaction term combining all variables (if applicable).
Descriptive Statistics: Review descriptive statistics for all data points.
Visualization: Examine scatter plots for every variable.
Correlation Analysis: Calculate a correlation matrix for all included variables.
Simple Linear Regression: Perform a simple linear regression for each individual variable.
Multiple Linear Regression (Base): Calculate multiple linear regression involving all variables without interactions.
Interaction Modeling: Systematically add various interactions to observe changes in the model.
Final Synthesis: Draw overall conclusions based on the totality of evidence gathered from all models.
Quantitative Model Comparison: UN11 Dataset (Life Expectancy)
Model 1: Interaction Model
Equation Structure:
Variable | Estimate () | Std. Error | t-Value | Pr(> | t | ) |
|---|---|---|---|---|---|---|
(Intercept) | ||||||
other | ||||||
africa | ||||||
| ||||||
other: | ||||||
africa: |
Residual Standard Error: with df.
R-squared (): .
Model 2: Main Effect Model
Equation Structure:
Variable | Estimate () | Std. Error | t-value | Pr(> | t | ) |
|---|---|---|---|---|---|---|
(Intercept) | ||||||
other | ||||||
africa | ||||||
|
Residual Standard Error: with df.
R-squared (): .
Relationship Between Main Effects and Interactions
Independence: Main effects and interactions are independent of each other.
Possible Combinations:
Main effects without interactions.
Interactions without main effects.
Both main effects and interactions.
Neither main effects nor interactions.
Graphical Identification:
Interactions: The less parallel the lines are on a graph, the more likely there is a significant interaction. A "crossover interaction" occurs when the lines intersect.
Main Effects: On a graph with two groups (e.g., represented by black diamonds and open circles), the main effect is determined by whether one group is, in general, higher or lower than the other group across the x-axis.
Parallel Lines: If lines are perfectly parallel, there is no interaction, but there may still be significant main effects for either or both variables.