PING
0.9
Statistical data handling and processing in production environment
|
Sum personal (P) variable(s) over households (i.e., by row and columns).
yyyy
: reference year;ids
: (option) type of input dataset; default: ids=P
;var
: name of variable on which the sum is calculated;by
: list of variables used for GROUP BY condition in SQL statement; by default: by=PB010 PB020 PHID
is used;ilib
: (option) name of the input library; by default: ilib=pdb
.odsn
: (option) name of the output dataset (in WORK
library); by default: odsn=HSUM
;ovar
: (option) sum variable; by default: ovar=hsum
;rvar
: (option) sumrow P variables ;by default: rvar=Ptot
;olib
: (option) name of the output library; by default: olib=WORK
.Let us consider the test dataset #45: DB020 | DB010 | RB030 |EQ_INC20 | RB050a :-—:|:--—:|-------—:-----—:|------— BE | 2015 | 3310 | 10 | 10 BE | 2015 | 3311 | 10 | 10 BE | 2015 | 3312 | 10 | 10 BE | 2015 | 4434 | 20 | 20
and run the macro:
which updates QUANTILE with the following table:
DB020 | DB010 | RB030 | EQ_INC20 | RB050a | QUINTILE | QUANTILE |
---|---|---|---|---|---|---|
BE | 2015 | 3310 | 10 | 10 | 1 | QUINTILE 1 |
BE | 2015 | 3311 | 10 | 10 | 1 | QUINTILE 1 |
Run macro %_example_income_quantile
for more examples.
In short, the macro runs the following PROC SQL
procedure: