proc sql - SAS - summing values down observations -


i sum values set of observations, specific column based on specific identifier. example, suppose have data below

a 4 5 6 b 3 3 2 3 4 2 c 3 2 0 b 3 7 3 b 2 4 1 

suppose want sum of values identifier in column 1, have totals a, b , c specific column of choice (2, 3 or 4). in separate data set output either a, b or c beyond criteria.

for example, want sums of column 4 (based on identifier in column 1) above value of 1, output data set should return = 8, b = 6, , nothing c zero.

i open proc sql, or data step, in fact useful know both methods.

you can use sql - groupby - sum aggregate function


Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -