I am using the following code to estimate the average of a column:
rsubmit;
proc sql;
create table want as
select *, mean(total_balance) as avg_balance
from have;
quit;
endrsubmit;
in the following dataset:
total balance
100
200
300
400
and I am getting output
total balance avg_balance
100 100
200 200
300 300
400 400
instead of
total balance avg_balance
100 250
200 250
300 250
400 250
what am I doing wrong?