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)?
Please test your code before posting to make sure it works. The code you provided does not work. I request that you fix it.
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.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.
Ready to level-up your skills? Choose your own adventure.