Hello, guys. I just learned SAS, and I have been puzzled for many days. I hope you can help me.
My data is the number of relapses(Y) in different treatment groups (group=1,2,3) , and I want to compare the difference in the number of relapses in different treatment groups under the least squares mean estimation. I used the lsmeans statement to compare the differences. It outputs the difference of the estimated coefficient(Beta1-Beta3, Beta2-Beta3). But I want to get the differences of Y.
my data is like:
id group relapse_count lntime
1 1 0 -1.108
2 2 1 -0.693
3 3 1 -3.218
4 2 2 -1.108
.........
here is my SAS codes:
proc genmod data=a;
class group(ref="3") id/param=glm;
model relapse_count=group/link=log dist=negbin offset=lntime;
repeated subject=id;
lsmeans group/cl ilink exp ;
estimate '2-1' group -1 1 0/exp;
estimate '1-3' group 1 0 -1/exp;
estimate '2-3' group 0 1 -1/exp;
run;
I would appreciate it if you could help me!
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.