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
Bootstraping after "mi estimate, cmdok: sureg"Hi Statalist, I would like to test the significance of the indirect effect of multiple mediators. T…
xtreg with low R-sqHello, I have two dependent variables and 9 independent variables. I ran xtreg command using the f…
Problems constructing a Variable indicating the share of male and female in an occupationDear Statalisters, I am currently working on a university project and am struggeling to build a var…
Bootstrapping multi-level logit model with endogenous predictor using control function (Wooldridge): Handling fixed effects in bootstrapDear all I am seeking to implement the control function approach in the context of a multi-level mo…
Matrix row calculationsHey everybody, once again im asking for your help! Could you please tell me how to multiply the elem…
Subscribe to:
Post Comments (Atom)
0 Response to Plotting results from nonlinear effects
Post a Comment