0
votes

Is there any way to take multi level summary of data, only choosing observations corresponding to unique values of a certain variable in sas?

I want to run something like a proc summary, but in each segment defined by TYPE i only want to sum the values corresponding to unique values of an identifier variable.

I'm giving below a mock data, and a template of the desired output.

https://docs.google.com/spreadsheets/d/1c-IsQpgtNR0EEKCdKZkU6WC6TBGNfUaiiS5ZYZJumkQ/edit?usp=sharing

1
Please fill in the expected values based on your mock data, your logic isn't clear. Please also post your solution attempt. As is, your question does not fall into SO rules. Also, embed your images, external links don't last and in a question such as yours the sample and output are an important part of the question.Reeza

1 Answers

0
votes

I'm not sure I understand your question, but I suppose you need proc means.

proc means data=sashelp.class n sum;
    class sex age;
    var weight;
run;