I want to answer the following questions:
For that, I have used the following piece of code:
PROC REG DATA=ALL;
MODEL Y = X Z1 Z2 XZ1 XZ2 Z1Z2;
INTERCEP: TEST Z1, Z2;
SLOPE: TEST XZ1, XZ2;
COINCID: TEST Z1, Z2, XZ1, XZ2;
How can I interpret the results?
Comments will be deeply appreciated...
X is a continuous explanatory variable; Y is a continuous dependent variable, Z1 and Z2 are dichotomous variables. An example of the data is:
I'm surprised you don't get an error from PROC REG since Z1 and Z2 are perfectly correlated. But I really don't use PROC REG much any more.
I would do this in PROC GLM (in which case Z2 is not needed)
proc glm data=have; class z1; model y=x z1 x*z1; run; quit;
If the statistical test of the effect of Z1 is statistically significant then the intercepts are different. If the effect of X*Z1 is significant, then the slopes are different. I might want to think about this a little more, but if the tests for both Z1 and X*Z1 are both not significant, then the lines are coincident (except for random noise).
So in your original problem statement, you were performing statistical testing in PROC REG. Then you mark correct the answer which just draws plots. I don't think plots is the correct answer, although it may be very helpful to have a plot, there is no statistical testing going on.
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
For SAS newbies, this video is a great way to get started. James Harroun walks through the process using SAS Studio for SAS OnDemand for Academics, but the same steps apply to any analytics project.
Find more tutorials on the SAS Users YouTube channel.