# How to work with a mediating variable in a regression analysis?

A typical regression equation involves one or multiple dependent variables and one or multiple independent variables. Usually, the aim is to identify the impact of the dependent variables on the independent variables. However, in some cases, the independent variable does not have a direct influence on the dependent variable. Instead, the linkage between both variables exists through a middle variable. This middle variable is referred to as a mediating variable. Thus, the effect of the independent variable on the dependent variable due to the presence of a mediating variable is called the mediating effect.

For example, the loyalty of a consumer is though theoretically dependent on the quality of a product. But this linkage between the quality of product and loyalty of consumer is not direct. The quality affects their satisfaction with the product, which then influences their loyalty. Thus, satisfaction acts as a mediating variable in the relationship between quality and loyalty. The effect of variation in quality on consumer loyalty defined through the changes in the satisfaction level is called the mediating effect.

## What are the main forms of mediating effect?

The mediating effect can be categorized into three forms i.e. full mediating effect, partial mediating effect, or no mediating effect.

### Full mediation

- Herein the linkage between the dependent and independent variable is completely based on the mediating variable i.e. no direct linkage could exist in the absence of mediating variable.
- For example, job contribution of teachers links the organizational commitment and engagement of teachers. Thus, job contribution has a full mediating effect.

### Partial mediation

- Herein originally, linkage does exist between the dependent and independent variable. The mediating variable contributes to the relationship by representing a part of the linkage. Thus, even in the absence of mediating variable, dependent and independent variable could relate.
- For example, the perception of consumer work as a mediating variable in linking the expectation of consumer and their satisfaction level. However, even when perception is not included in the model, a link between the expectation of consumer and satisfaction could exist. Thus, the perception has a partially mediating effect.

### No mediation

- Herein the dependent and the independent variable is originally related and mediating variable does not contribute to the existing relationship. Thus, in the absence of a mediating variable, no effect occurs on the linkage between the dependent and independent variable.
- For example, while establishing a relationship between salary and health expenses, the role of age is required. As health expenses of an employee though do get affected by the age, but still, without including age in the model, the impact of variation in salary could be studied on the health expenses.

## Steps to analyse the effect of mediating variable

There are four steps to test the presence of a mediating variable in a regression model. These four steps are based on linking the independent and dependent variable directly and then testing the impact on the linkage in the presence of a mediating effect.

Let X be the independent variable, Y be the dependent variable and M be the mediating variable.

Steps followed for verifying the presence of mediating effect is listed below

- Build in the direct linkage between the independent and dependent variables (i.e. Regress Y on X)

- Test the relationship between the independent and mediating variable (i.e. Regress M on X)

- Verify the relationship between the mediating and dependent variable (i.e. Regress Y on M)

- Build in the model by including mediating variable as the independent variable and test the relationship between the independent and dependent variable (i.e. Regress Y on X and M)

## Identification of the mediating effect form based on the results derived from the analysis of the model

Following the above steps, the regression analysis for the independent, mediating, and dependent variable is carried. The form of mediating effect could be determined by examining the p-value of the model. Results of the analysis can be any one of the following:

- If the independent variable effect comes out to be zero i.e. the p-value of X is greater than the significance level of the study (Equation 4) considering the mediating variable effect as significant, then there is the full or complete mediating effect of M.
- If the independent variable is significant but the required significance level is different from zero i.e. p-value of X (Equation 4) is greater than zero but less than the study significance level. Then the model is said to have a partial mediating effect of M.
- In case of having the completely significant independent variable i.e. p-value of X is less than the significance level of the study (Equation 4), then the model has no mediating effect of M.

## Example case

Consider a case where the aim is to determine the impact of variation in the quality of purchased goods on the loyalty of consumers. The consumer satisfaction level is considered as the mediating variable which links the purchased good quality and consumer loyalty.

### Step 1: Regress consumer loyalty on the quality of purchased goods

In order to assess this mediating role of consumer satisfaction, initially, the linkage between the dependent and independent variable is verified and below stated hypothesis is tested:

H

_{01}: There is no significant impact of purchased good quality on the loyalty of consumer.H

_{A1}: There is a significant impact of purchased good quality on the loyalty of consumer.

Regression results are shown in the below tables.

Consumer Loyalty | Coefficient | T-statistic | p-value | R^{2} | Adjusted R^{2} | F Ratio |
---|---|---|---|---|---|---|

Constant | 3.497 | 13.259 | .000 | .017 | .007 | 1.735 |

Purchased Good Quality | .096 | 1.317 | .191 |

Above table shows that the model is not efficient enough to determine the impact of purchased good quality on the loyalty of consumer as R2 value is 0.017. The linkage between the variables is also not significant as the p-value of purchased good quality is 0.191 > 0.05. Thus, the null hypothesis that there is no significant impact of purchased good quality on the quality of purchased goods is not rejected.

Thus, the results of the above model show that no direct linkage between the variables can be established.

### Step 2: Regress consumer satisfaction on the quality of purchased goods

Considering the mediating role of consumer satisfaction, the relationship between the quality of purchased goods and consumer satisfaction is analyzed by testing below stated hypothesis:

H

_{02}: There is no significant impact of purchased good quality on the consumer satisfaction level.H

_{A2}: There is a significant impact of purchased good quality on the consumer satisfaction level.

Regression results of the above hypothesis are shown in the below table.

Consumer Satisfaction | Coefficient | T-statistic | p-value | R^{2} | Adjusted R^{2} | F Ratio |
---|---|---|---|---|---|---|

Constant | 1.941 | 7.205 | .000 | .331 | .324 | 48.515 |

Purchased Good Quality | .520 | 6.965 | .000 |

Table 2 shows that the R^{2} value of 0.331 shows that about 33.1% of the variation in the value of consumer satisfaction level is represented by the change in purchased good quality. Furthermore, there is a significant relationship between the independent and mediating variable as the p-value of the purchased good quality is 0.000 which is less than the significance level of the study i.e. 0.05 and hence null hypothesis is rejected. Therefore, there is a direct linkage between the variables.

### Step 3: Regress consumer loyalty on consumer satisfaction

Focusing on the linkage between the consumer loyalty and satisfaction level of consumer, this step would test the below-stated hypothesis:

H

_{03}: There is no significant impact of consumer satisfaction level on consumer loyalty.H

_{A3}: There is a significant impact of consumer satisfaction level on consumer loyalty.

Regression results are shown in below table.

Consumer Loyalty | Coefficient | T-statistic | p-value | R^{2} | Adjusted R^{2} | F Ratio |
---|---|---|---|---|---|---|

Constant | 2.152 | 8.202 | .000 | .320 | .313 | 46.073 |

Consumer Satisfaction | .457 | 6.788 | .000 |

Results shown in Table 3 depicts that the value of R^{2} is 0.320 thus depicting that about 32% of the variation in the consumer loyalty could be depicted by considering variation in the consumer satisfaction level. Furthermore, the p-value of consumer satisfaction is 0.000 which is less than 0.05, the significance level of the study. Thus, the null hypothesis of having no significant impact of consumer satisfaction level on consumer loyalty is rejected hence, stating that there is a significant positive contribution (as coefficient value is 0.457) of consumer satisfaction is influencing the consumer loyalty level.

### Step 4: Regress consumer loyalty on purchased good quality and consumer satisfaction

Herein, the impact of purchased good quality on consumer loyalty is analyzed by considering consumer satisfaction as a mediating variable. Below stated hypothesis is tested.

H

_{0}: There is no mediating role of consumer satisfaction on the relationship between quality of purchased goods and consumer loyalty.H

_{A}: There is a mediating role of consumer satisfaction on the relationship between quality of purchased goods and consumer loyalty.

Results of the regression are shown in the below table.

Consumer Loyalty | Coefficient | T-statistic | p-value | R^{2} | Adjusted R^{2} | F Ratio |
---|---|---|---|---|---|---|

Constant | 2.349 | 8.990 | .000 | .376 | .363 | 29.196 |

Purchased Good Quality | -.211 | -2.949 | .004 | |||

Consumer Satisfaction (Mediating) | .591 | 7.462 | .000 |

Above table shows that the value of R^{2} and Adjusted R^{2} has improved as compared to the results of Equation 1 i.e. R^{2 }value has increased from 0.017 to 0.376 and Adjusted R^{2} value from 0.007 to 0.363. This improvement in value shows that the variation in the value of consumer loyalty is more appropriately defined by including mediating variable, consumer satisfaction in the model. About 36.3% of the variation in consumer loyalty is now represented by the independent and mediating variables. Furthermore, the F-ratio has increased from 1.735 to 29.196 thus showing a more accurate prediction of consumer loyalty could be done now. Finally, the p-value of the mediating variable is 0.000 which is less than the significant level of the study i.e. 0.05 thus showing the significant contribution of the mediating variable in the model.

Furthermore, mainly to determine the form of mediating effect in the model, the p-value of purchased good quality (independent variable) is analyzed. Initially in model 1, the linkage between the consumer loyalty and purchased good quality had the insignificant p-value i.e. 0.191. However, with the inclusion of the mediating variable, the p-value has decreased to 0.004. Though the p-value is less than the significant value of the study i.e. 0.004< 0.05, but it is not 0 hence showing the full or complete mediating effect of consumer satisfaction is not present in the model. As the p-value is 0.004, the null hypothesis that there is no mediating effect of consumer satisfaction on the relationship between the quality of purchased goods and consumer loyalty is rejected. Hence, the model formulated to represent the impact of purchased good quality on consumer loyalty by including the partial mediating effect of consumer satisfaction is significant.

- Conditional CAPM analysis for stock-based investing - February 20, 2021
- Short term momentum analysis of growth, income and value stocks - February 9, 2021
- Inferential analysis to compare the performance of stocks listed in the BSE (2011-2020) - January 30, 2021

## Discuss