Hi all; I want to know if there is another better way to add the group number easily,when using the PROC FREQ procedure to caculate the P value.
If I understand correctly, you're starting with the data set you have shown, minus the A and B columns. Depending on what they are supposed to contain (you really have shown just an abbreviated version), here is one way to add them:
data want;
set have;
by trt notsorted;
if first.trt then do;
A + 1;
B = 1;
end;
else B + 1;
run;
Even if this isn't the right result, you will probably need some variation on these tools to get what you want.
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.