Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • "proportion mediated" using gsem and nlcom

    Hi,
    I am running a mediation analysis on clinical data using "gsem", where the outcome variable is lood Pressure control at the last visit ( "bpcontrol_last_visit_mean", 0/1 dummy variable), mediators are: number of missed visits (count variable - "total_missed_within4wks" ), log.average visit interval (continuous variable - "ln_avg_visit_frequency"), a medication intensification score (continuous variable - "sbm"). Our predictor is race (black vs. white).

    eststo: gsem (total_missed_within4wks <- blackwhite i.age_category i.gender dmdiagnosed sbp_baseline_mean, family(poisson) exposure(totalvisit_uncontrolled_between)) /*
    */(ln_avg_visit_frequency <- blackwhite i.age_category i.gender dmdiagnosed sbp_baseline_mean) /*
    */(sbm <- blackwhite i.age_category i.gender dmdiagnosed sbp_baseline_mean) /*
    */(bpcontrol_last_visit_mean <- total_missed_within4wks ln_avg_visit_frequency sbm blackwhite i.age_category i.gender dmdiagnosed sbp_baseline_mean, family(bernoulli) link(logit)) if e(sample)

    I would like to calculate the "proportion mediated", namely what percentage of the total effect of black race on BP control is mediated through each of the three mediator variables.

    Here is what I did:

    ****Indirect effects
    nlcom ind1: exp([total_missed_within4wks]_b[blackwhite])*[bpcontrol_last_visit_mean]_b[total_missed_within4wks]
    nlcom ind2: [sbm]_b[ blackwhite]*[bpcontrol_last_visit_mean]_b[sbm]
    nlcom ind3: [ln_avg_visit_frequency]_b[ blackwhite]*[bpcontrol_last_visit_mean]_b[ln_avg_visit_frequency]

    *****Total Effect
    nlcom tot: exp([total_missed_within4wks]_b[blackwhite])*[bpcontrol_last_visit_mean]_b[total_missed_within4wks]/*
    */+[sbm]_b[blackwhite]*[bpcontrol_last_visit_mean]_b[sbm]+[ln_avg_visit_frequency]_b[ blackwhite]*[bpcontrol_last_visit_mean]_b[ln_avg_visit_frequency]/*
    */+[bpcontrol_last_visit_mean]_b[blackwhite]

    Is the calculation correct? And for the "proportion mediated", would it be correct to do:
    ind1/tot
    ind2/tot
    ind3/tot

    ?

    Thank you in advance for your advice.
    Kind Regards,

    -Lucia

  • #2
    Hi Lucia, did you manage to figure this out? Asked a similar question on here, but no luck yet.

    Comment

    Working...
    X