Hello all,

I have panel data and want to calculate a mediation
IV: Independent variable
MV: Mediator variable
DV: Dependent variable

I have the following questions:
1. Does the following code seem appropriate to you?
2. I checked for heteroskedasticity and it seems that my model has heteroskedasticity. Is there a way to do the code below with robust standard errors? The -suest- command does not seem to work with -bootstrap-
sureg (mv iv)(dv mv iv)

capture program drop bootmm

program bootmm, rclass syntax [if] [in]

sureg (mv iv)(dv mv iv) `if' `in'

return scalar ind1 = [mv]_b[iv]*[dv]_b[mv]

return scalar indtotal = [mv]_b[iv]*[dv]_b[mv]

end

bootstrap r(ind1) r(indtotal), bca reps(5000): bootmm



It would be really really great if you could help me!