Dry goods sharing: Application and R realization of mediating effect model in medical Research


In recent years, with the development of medical research, mediating effect model analysis has been paid more and more attention by medical researchers.Ingenious application of the mediation effect model can also make my own research more than simply the correlation between X and Y, and add color to the article.Therefore, this issue of Mase Academic will introduce the application and R realization of mediating effect model in medical research.Definition of mediating Effect If the independent variable X exerts a certain influence on the dependent variable Y through some variable M, M is called the mediating variable of X and Y.The purpose of studying mediating effect is to explore the internal mechanism of the relationship between X and Y based on the known relationship between X and Y.The overall effect of X on Y can be divided into directeffect and indirect effect. Directeffect refers to the effect of independent variable X on outcome variable Y when the intermediate variable (M) is fixed at a certain level.Indirect effect refers to the influence of independent variable X on outcome variable Y through intermediary variable M.As shown in the figure above, C is the direct effect, and the indirect effect is the combination of A and B.According to Baron and Kenny et al., variables that meet the following criteria can be considered as mediators: 1.Changes in exposure levels significantly affect changes in the level of mediators (i.e., the association between X and M is statistically significant).2. Changes in the level of mediators significantly affect outcome variables (that is, the association between M and Y is statistically significant).3. Changes in exposure factor levels significantly affected outcome variables (i.e., the association between X and Y was statistically significant).The R of the mediation effect implements the Mediate function in the Mediation package that is required to implement the mediation effect.This paper will use the data set “Jobs” in R language to explore whether the independent variable treat has an effect on the outcome variable Depression through the intermediary variable Job_seek.The sample dataset explains the Jobs data based on data obtained from the Job Search Intervention Study (Jobs II).The study was a randomized field experiment to investigate the effectiveness of a job training intervention for unemployed workers.The aim is not only to increase the re-employment of the unemployed, but also to improve the mental health of job seekers.In JOBS II Field’s experiment, 1,801 unemployed workers received a pre-screening questionnaire and were then randomly assigned to a treatment group or a control group.People in the treatment group attended workshops on job skills.During the workshop, interviewees learned job hunting techniques and strategies for coping with setbacks during the job search process.A control group received a booklet on job-hunting tips.During follow-up interviews, two key outcome variables were measured (a continuum variable for depressive symptoms based on the Hopkins Symptom Checklist and a dichotomous variable representing whether the respondent was employed or not).The hypothesis variables of the model explain job_seek: the continuous variable of job-seeking self-efficacy level score ranging from 1 to 5.Is the mediating variable depress2: depression symptom measurement score after treatment in this study, and is the outcome variable in this study.Treat: The indicator variable of whether participants were randomly selected to participate in the JOBS II training program, 1 was assigned to participate in the JOBS II training, and was the exposure factor variable of the study.Covariate: ECON_HARD for economic hardship pre-processing values from 1 to 5.Sex and age are the Sex and age of the participants.Install. Packages (” Mediation “) ### Install the mediation effect analysis package2. Library (mediation) ### Load the mediation function 3.4.b < -lm (job_seek ~ treat +econ_hard + sex + age, data=jobs)5. C < -lm (depress2 ~treat + job_seek +econ_hard + sex + age,Data =jobs) ### independent variable treat is fitted to the outcome variable depress2 model where the c pathway is assumed (condition 3 should be met by the mediator variable).At this point, the intermediary variable job_seek should be included in the model as a covariable.6. contcont <-mediate(b, c, sims=50, Mediating effect analysis of job_seek between independent variable TREAT and outcome variable depressionThe model fitting results are shown in the figure below.ACME represents an indirect effect (INDIRECT effect) and ADE represents an averagedirect effect (direct effect).Total effect means total effect.The percentage of prop. mediated explaining the association between X and Y, in this case, was 21.69%.The three lines in the figure below are all crossed with line 0, showing no statistical significance.Results of mediating effect analysis The overall mediating effect diagram can be shown as the figure above, but the indirect effect of the mediating variable (IE value has no statistical significance) can be interpreted as that the variable has no mediating effect.When the indirect effect of the mediating variable, IE, is statistically significant, the mediating effect model can be considered to be established and factor M mediates the association between factor X and Y.It should be pointed out that mediation analysis belongs to the category of causal inference in the theoretical framework of epidemiology. The correct implementation and understanding of mediation analysis requires researchers to fully understand the nature of the exposure factors studied and other related factors in the logical chain of outcome, and to accurately judge the concepts of confounding and interaction.Excellent case recommendation:A large population-based cohort study (US NHANES and UK Biobank, with more than 40,000 and nearly 400,000 participants from the general population in the US and UK, respectively) examined the mediating role of healthy lifestyles between socioeconomic status and all-cause mortality.The results were published in the prestigious medical journal BMJ (DOI: 10.1136/ BMJ.n604) in 2021.References: Psychol Methods. 2013June;18(2): 137-150. Article: Students at Lojiashan University Editing: Students at Lojiashan University Authorized reprint please contact the Mace Academic Administrator for further information

Leave a Reply

Your email address will not be published.