BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
swBuenoLopez
Calcite | Level 5

I want to answer the following questions:

  • are the lines coincident?
  • are the slopes different?
  • are the intercepts different?

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;

        RUN;

How can I interpret the results?

 

Comments will be deeply appreciated...

 

Best,

 

Santiago

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Sometimes a picture is worth a lot of tests:

 

proc sgplot data=have;
   reg x=x y=y/group=z1;
run;

Or set ods graphics one and use the PLOTS statement of Proc Reg or Proc GLm or ...

View solution in original post

7 REPLIES 7
PaigeMiller
Diamond | Level 26

More explanation is needed.

 

What are the variables X Z1 Z2 XZ1 XZ2 Z1Z2?

 

 

--
Paige Miller
swBuenoLopez
Calcite | Level 5

X is a continuous explanatory variable; Y is a continuous dependent variable, Z1 and Z2 are dichotomous variables. An example of the data is:

YXZ1Z2
0.3844811134.9410
0.4287210280.3410
0.4539112595.4010
0.269547461.2710
0.4927613352.5910
1.0970633692.4010
0.315298987.0410
0.206295190.8010
0.4901115962.3410
0.235856454.9610
0.5490114717.2510
0.262697757.7210
0.6217314394.4410
0.6038318041.0210
0.4775613406.9810
0.4416811272.1910
0.092052349.1010
0.322218780.7810
0.191885586.2410
0.194674797.4010
0.087932121.8010
0.132473744.6010
0.223535683.0410
0.093432175.0110
0.4790213764.6301
0.218215703.7501
0.083211954.2201
0.159064490.1601
0.5041815138.0001
0.088472178.0001
0.166864471.2001
0.175714435.7601
0.272877337.3001
0.056311362.1801
0.131353717.1201
0.4139111741.9101
0.130253207.2401
0.3405510097.3801
0.329048126.6001
0.4750912354.7501
0.8038323064.0001
0.6665018758.0801
ballardw
Super User

Sometimes a picture is worth a lot of tests:

 

proc sgplot data=have;
   reg x=x y=y/group=z1;
run;

Or set ods graphics one and use the PLOTS statement of Proc Reg or Proc GLm or ...

PaigeMiller
Diamond | Level 26

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).

--
Paige Miller
swBuenoLopez
Calcite | Level 5

Thanks so much, ladies and gentlemen...your support is deeply appreciated!!!!

PaigeMiller
Diamond | Level 26

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.

--
Paige Miller

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 7 replies
  • 992 views
  • 0 likes
  • 3 in conversation