I am looking at how my outcome y evolves over time assuming such evolution may differ by x (binary).
I assume a nonlinear effect of time, which I operationalize as a quadratic effect.
Therefore I have time and time squared in my model, and I interact x with time, so my model looks like
xtreg y time##x timesquare##x, i(pid)
How can I plot y trajectories over time by x?
In a model with a linear effect of time or where I treat time with dummies for each time point I would use “marginsplot” as below…but I cannot figure out how to correctly apply that in the case of a quadratic effect.
xtreg y x##c.time, i(pid) /*or i.time if I want dummies for each time*/
margins x, at(time=(0(5)50))
marginsplot
thanks. Any suggestions is welcome.
Anna
Related Posts with Plotting results from nonlinear effects
Question CEO Duality applying to whole firm in a yearHello everyone, For my thesis I have to investigate CEO Duality. CEO Duality is when the CEO of the…
Generate dummy variables if it is the same day / monthI would like to generate two dummy variables: "same_month" and "same_day". Basically, by id and grou…
Identifying segments based on binary variableDear Statalist, For a panel of 60 countries I need to calculate the average for every 'segment' of…
Plotting trends of a binary variable over timeHi all, I am working with pooled cross sectional data and after having done probit and marginal eff…
Panel data with binary and group variables as independent variablesHello, I am new to Stata and Econometrics in general, and I am really struggling to choose the righ…
Subscribe to:
Post Comments (Atom)
0 Response to Plotting results from nonlinear effects
Post a Comment