Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* ALL OKLAHOMA */
- /* CALCULATE PROPORTION OF LOW INCOME FAMILIES */
- /* Get data with households that house a single family */
- DATA singlefamilyhhtokl;
- SET project.g6oklcol;
- IF state=40;
- IF hht=1 or hht=2 or hht=3;
- run;
- /*Total Number of Rows = 45568 */
- proc sql;
- select puma1, count(*) as N_Obs
- from singlefamilyhhtokl
- group by puma1;
- quit;
- /*median of single family household*/
- PROC MEANS data=singlefamilyhhtokl(where=(persons=4)) median noprint;
- class puma1;
- var hinc;
- weight hweight;
- output out = test median= med;
- run;
- proc print data=test;
- run;
- /*Get count of low income households based on listed conditions*/
- proc sql;
- select count(*) as N_Obs
- from singlefamilyhhtokl
- where persons=4 and hinc<.8*(42900)
- or
- persons=3 and hinc< .9*(.8*(42900))
- or
- persons=2 and hinc< .8*(.8*(42900))
- or
- persons=5 and hinc< 1.08*(.8*(42900))
- or
- persons=6 and hinc< 1.16*(.8*(42900))
- and
- puma1=40100;
- quit;
- /*N_Obs =15698*/
- /*Proportion : 15698/9228 = */
- proc sql;
- select count(*) as N_Obs
- from singlefamilyhhtokl
- where persons=4 and hinc<.8*(49000)
- or
- persons=3 and hinc< .9*(.8*(49000))
- or
- persons=2 and hinc< .8*(.8*(49000))
- or
- persons=5 and hinc< 1.08*(.8*(49000))
- or
- persons=6 and hinc< 1.16*(.8*(49000))
- and
- puma1=40201;
- quit;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement