Announcement

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

  • Test for mediation using panel data (with some missing data).

    I've tried this a few different ways now and each come up with an error message. Is there a command which can test for mediation when some years of the panel data are missing?

    More specifically: I have six years worth of data. My independent variable has datapoints for each of the six years. My mediator has data for years 1-4. My dependent variable has data for years 5 and 6 only. I also have control variables with some missing data. Is it possible to test for mediation or would I need the missing datapoints (which I can't get)? I've been trying different versions of the following command (e.g., with and without lags; fixed effects and random) to no avail:

    xtivreg DepVar (l1.MedVar=l2.IndepVar) l1.ControlVarOne l1.ControlVarTwo, fe

    The two most common errors I get are: 1) sample specifies cross-sectional data and 2) no observations. Unfortunately, I've been requested NOT to run the analysis as cross-sectional, so thats not an option.

    Any help would be greatly appreciated, as I'm fairly new to Stata!

    Thanks in advance,
    Steve

  • #2
    You could run the model estimating iv's on mediator and then a separate model of the mediator and iv's on the outcome. The estimates could be panel estimators. If you look at the literature, I think older papers and texts will tell you have to analyze the mediation from there. However, I'm not sure you can handle the endogeneity without data from the same years.

    This is not really a Stata problem as much as a general specification issue. If you can figure a general way to solve your problem, we can help you implement it in Stata.

    By the way, you'll have a greater chance of a useful answer if you follow the FAQ on asking questions - provide Stata code in code delimiters, Stata output, and sample data using dataex.

    Comment

    Working...
    X