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
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
Comment