I am working on replicating a SAS code into a R code and I came across the following SAS code snippet -
proc means data=A noprint;
by name date;
id comp_no;
var price;
id rep_dats act no;
output out= test(drop=_type_ _freq_)
median=median n=num;
run;
I know that the 'by' statement is used to group by to give statistics at that level. But, what is 'id' used for? Why are there two 'id' statements? I checked out SAS help but I didn't really understand it. I also checked out their examples at http://support.sas.com/documentation/cdl/en/proc/65145/HTML/default/viewer.htm#p19dfq16fqt1t3n1eroiabnn6r3s.htm. But there was no example illustrating the use of ID.
As I don't have access to SAS, I can't try this out and see how the output looks like. Any clarifications would be of great help to me. Thanks!