BookmarkSubscribeRSS Feed
thanikondharish
Calcite | Level 5

data rawdata ;
input ID treatment $ age_GROUP weight ;
cards ;
1 A GRP1 90
2 A GRP1 80
3 A GRP2 90
4 A GRP1 70
5 A GRP2 80
6 A GRP2 80
RUN;

 

how to find slope difference (95% CI) confident interval between two treatment groups with subgroup wise (age group)?

2 REPLIES 2
PaigeMiller
Diamond | Level 26

Please test your code before posting to make sure it works. The code you provided does not work. I request that you fix it.

--
Paige Miller
Rick_SAS
SAS Super FREQ

To answer this question, your data needs three variables: the response variable, the explanatory variable, and a classification (group) variable. Let's use the Sashelp.Class data set and use PROC GLM to fit a linear model that predicts Weight from Height for each age group=13,14,15 year old students.

 

ods graphics on;
proc glm data=sashelp.class(where=(age>12 & age<16)); class age; model weight = height | age / solution clparm; quit;

If you run this code, you will get a graph that shows how the predictions for Weight depend on Height for each Age group. The slopes of each regression line are the parameter estimates for the Height*Age interaction term.

 

You can see that the difference in slope between the Age=13 students and the Age=15 students (the reference group) is -0.73, which means that the Age=13 regression line has a smaller slope than the Age=15 line. The confidence limits for the slope are [-8.7, 7.2], which includes 0, so the difference is not statistically significant.

 

Similarly, the difference in slope between the Age=14 students and the Age=15 students (the reference group) is -0.01, which means that the Age=13 regression line has essentially the same slope as the Age=15 line. The confidence limits for the slope are [-8.7, 8.7], which includes 0, so the difference is not statistically significant.

 

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!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 629 views
  • 1 like
  • 3 in conversation