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.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.