To whom can solve this problem:

Please kindly help! I need to draw an interaction plot figure to see the moderator effect. However, I tried codes such as "margins" according to the state help guide but it did not work... Also I need to do additional control but do not know how...The data seting is as follows:

I use "xtgls" to regress "y x1 x2 x1*x2 x3 x4", among which x1 x2 are independent variables, and x3 and x4 are controlled variables. x2 moderates the relationship between x1 and y.

x1 and x2 are continuous variables. x1 ranges from -0.36 to 0.06. x2 ranges from -0.71 to 1.42.

Except for x1 and x2, other variables (x3 and x4) need to be constrained to their mean values.

It is expected that x-axis is for x1, and y-axis is for y; there are two lines in the plane, showing x1*high-level_x2's relationship with y and x1*low-level_x2's relationship with y respectively.

It is also expected that there would be a second figure with the differences between the two lines in the first figure at the y-axis and with x1 at the x-axis.

Both figures need labels of the variables at their places.

Please help with this. Looking for your guidance!

Thank you!