A moderating variable is a third variable that affects the strength of the relationship between the independent and dependent variable in data analysis. Examples of moderating variables include sex and race.

Moderating variables are important in scientific analysis where the researchers want to determine the correlation between two variables. Scientists often look at moderating variables to analyze the effect of the variable on a particular outcome. For example, researchers have studied the effect of social support on the correlation between stress and depression. Although high stress levels generally correlate with high depression levels, social support moderates the strength of the correlation. Thus, with greater social support, a person experiences less depression as a function of higher stress levels.

Researchers must stay on the lookout for the effects of moderating variables when analyzing their study results because moderating variables have the potential to affect research outcomes.

Students sometimes confuse moderating variables with mediator variables. Mediator variables are variables that explain the correlation between two variables, while moderating variables affect the relationship between two variables. For example, throughout the population, there is a correlation between weight and income. However, weight also increases with age, and income also typically increases with age. Age is the mediating variable that explains the correlation between weight and income level.