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.
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.