BookmarkSubscribeRSS Feed
Juan_Manriquez
Calcite | Level 5

How I can run the equation to determine the difference between two slopes in SAS?

 

t = (b1 - b2) / SQRT(s^2b1 + s^2b2), df = n1 + n2 -4

 

b = slope ; s = standard error ; df = degree of freedom and n = sample size

 

Thanks in advance,

 

Juan Manriquez

2 REPLIES 2
PaigeMiller
Diamond | Level 26

This is equivalent to testing if the two slopes are equal. To do that, in a regression sense, you fit an interaction, and if the interaction is not statistically significant, then the two slopes are not statistically different.

 

For example, if the class variable ID contains values 1 and 2, and this is used to produce two slopes

 

proc glm data=have;
    class id;
    model y = id x id*x;
run;
quit;
--
Paige Miller
Juan_Manriquez
Calcite | Level 5
Thanks Paige, I will check it
Juan

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 1067 views
  • 2 likes
  • 2 in conversation