Does anyone know how to graph changes in a dependent variable over time, based on changes in several independent variables (i.e., graphs for panel data regressions)?
-
1$\begingroup$ When there is no unobservable heterogeneity in panel data, we essentially have $n$ iid time series, where $n$ is the number of individuals in sample. One way is to graph all $n$ time series on one picture (you can also the changes of average dependent variable with respect to the average of independent variable(s)). It is hard to graph changes when there is unobservable heterogeneity. Imagine there is an unobservable variable $Z$, denoting fixed effect. When $Z$ takes $K$ possible values, the data then contains $K$ clusters. We need to graph changes for each cluster. $\endgroup$– semibruinSep 27, 2014 at 17:27
1 Answer
If you are using Stata you could use "margins" after the regression and then the "marginsplot" command.
So, your command can look like this:
xtreg y x1 x2 x3... , fe
margins, over (x1) at (x2 = (20 30 40 50))
marginsplot