Announcement

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

  • Looking for Stata package for mediation analysis allowing for factorial variables

    Hi everyone,

    I am writing to know if Stata packages for mediation analysis are available.
    I found some information about "-paramed-" and "-medeff-" commands, but they did not quite fit into my data structure.

    I have a panel data, for some observations they have repeated measurements (two repeats) for the primary predictor, for others only one measurement per observation. Outcome variable is continuous. I am applying multiple linear regression model with -cluster- option for standard error computation. Based on these, -medeff- seems more appropriate because it allows for -cluster- option, but the issue here is that it does not support factorial variables. Both of my key predictor and other confounders are categorical variables, so have to be included as i.varname in the model.

    I greatly appreciate if anyone could give me some insights on the alternative methods to overcome the issue or some other ways to perform mediation analysis.

    Thanks so much.

    Best regards,
    Mengmeng

  • #2
    You can use Stata's -gsem- (Generalized Structural Equation) command to fit the model. It will all factor variable notation and can adjust the model for repeated measures. See help for -gsem-
    Roman

    Comment


    • #3
      It is also possible to run dummy variables without using factor variable notation - look at the xi command. Most Stata-provided routines don't require xi since they work with factor variables, but there is nothing to stop you from generating your dummy variables yourself. This is not generally recommended since it wastes time and also makes using margins trickier.

      Comment


      • #4
        The -khb- user-written routine for mediation analysis will accept factor variables. See -ssc describe khb-.

        Comment

        Working...
        X