Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* ALL NEW JERSEY */
- /* Get the summary statistics */
- PROC MEANS DATA=PROJECT.gnj mean median n stddev min max;
- var finc hinc ;
- run;
- /* CALCULATE PROPORTION OF LOW INCOME FAMILIES */
- /* Get data with households that house a single family */
- DATA singlefamilyhht;
- SET project.gnj;
- IF hht=1;
- run;
- /*Total Number of Rows = 83267 */
- /*median of single family household*/
- PROC MEANS data=singlefamilyhht(where= (persons=4)) median;
- var hinc;
- weight hweight;
- run;
- /*Note median =82300.00*/
- /*Get count of low income households based on listed conditions*/
- proc sql;
- select count(*) as N_Obs
- from singlefamilyhht
- where persons=4 and hinc<.8*(82300)
- or
- persons=3 and hinc< .9*(.8*(82300))
- or
- persons=2 and hinc< .8*(.8*(82300))
- or
- persons=5 and hinc< 1.08*(.8*(82300))
- or
- persons=6 and hinc< 1.16*(.8*(82300));
- quit;
- /*N_Obs =29942*/
- /*Proportion : 29942/83267 = .35959 */
- /* CALCULATE PROPORTION OF LOW INCOME, AFFORDABLE, AND NOT CROWDED AMONG NEW UNITS */
- DATA newunits;
- SET project.gnj;
- IF yrbuilt=1
- or
- yrbuilt=2
- or
- yrbuilt=3;
- run;
- /*Total Number of Rows = 15275*/
- /*Get count of low income households based on listed conditions*/
- proc sql;
- select count(*) as N_Obs
- from newunits
- where
- (persons=4 and hinc<.8*(82300)
- or
- persons=3 and hinc< .9*(.8*(82300))
- or
- persons=2 and hinc< .8*(.8*(82300))
- or
- persons=5 and hinc< 1.08*(.8*(82300))
- or
- persons=6 and hinc< 1.16*(.8*(82300))
- )
- and
- persons <= rooms
- and
- (smocapi<= 30 or grapi<=30);
- quit;
- /*N_Obs =3567*/
- /*Proportion : 3567/15275 = .233519 */
- /* CALCULATE PROPORTION OF AFFORDABLE AND NOT CROWDED AMONG NEW UNITS OCCUPIED BY LOW INCOME FAMILIES */
- DATA NULI;
- SET project.gnj;
- where (yrbuilt=1
- or
- yrbuilt=2
- or
- yrbuilt=3)
- and
- (persons=4 and hinc<.8*(82300)
- or
- persons=3 and hinc< .9*(.8*(82300))
- or
- persons=2 and hinc< .8*(.8*(82300))
- or
- persons=5 and hinc< 1.08*(.8*(82300))
- or
- persons=6 and hinc< 1.16*(.8*(82300))
- );
- run;
- /*Total Number of Rows = 3843*/
- /*Get count of low income households based on listed conditions*/
- proc sql;
- select count(*) as N_Obs
- from NULI
- where
- persons <= rooms
- and
- (smocapi<= 30 or grapi<=30);
- quit;
- /*N_Obs =3567*/
- /*Proportion : 3567/3843 = .92818 */
- /* ALL OKLAHOMA */
- DATA oklahoma;
- SET project.g6oklcol;
- IF state=40;
- run;
- /*Total Number of Rows = 63590 */
- /* CALCULATE PROPORTION OF LOW INCOME FAMILIES */
- /* Get data with households that house a single family */
- DATA singlefamilyhht2;
- SET oklahoma;
- IF hht=1;
- run;
- /*Total Number of Rows = 36434 */
- /*median of single family household*/
- PROC MEANS data=singlefamilyhht2(where= (persons=4)) median;
- var hinc;
- weight hweight;
- run;
- /*Note median =51000*/
- /*Get count of low income households based on listed conditions*/
- proc sql;
- select count(*) as N_Obs
- from singlefamilyhht2
- where persons=4 and hinc<.8*(51000)
- or
- persons=3 and hinc< .9*(.8*(51000))
- or
- persons=2 and hinc< .8*(.8*(51000))
- or
- persons=5 and hinc< 1.08*(.8*(51000))
- or
- persons=6 and hinc< 1.16*(.8*(51000));
- quit;
- /*N_Obs =13812*/
- /*Proportion : 13812/36434 = .379096 */
- /* CALCULATE PROPORTION OF LOW INCOME, AFFORDABLE, AND NOT CROWDED AMONG NEW UNITS */
- DATA newunits2;
- SET oklahoma;
- IF yrbuilt=1
- or
- yrbuilt=2
- or
- yrbuilt=3;
- run;
- /*Total Number of Rows = 8827*/
- /*Get count of low income households based on listed conditions*/
- proc sql;
- select count(*) as N_Obs
- from newunits2
- where
- (persons=4 and hinc<.8*(51000)
- or
- persons=3 and hinc< .9*(.8*(51000))
- or
- persons=2 and hinc< .8*(.8*(51000))
- or
- persons=5 and hinc< 1.08*(.8*(51000))
- or
- persons=6 and hinc< 1.16*(.8*(51000))
- )
- and
- persons <= rooms
- and
- (smocapi<= 30 or grapi<=30);
- quit;
- /*N_Obs =2539*/
- /*Proportion : 2539/8827 = .28764 */
- /* CALCULATE PROPORTION OF AFFORDABLE AND NOT CROWDED AMONG NEW UNITS OCCUPIED BY LOW INCOME FAMILIES */
- DATA NULI2;
- SET oklahoma;
- where (yrbuilt=1
- or
- yrbuilt=2
- or
- yrbuilt=3)
- and
- (persons=4 and hinc<.8*(51000)
- or
- persons=3 and hinc< .9*(.8*(51000))
- or
- persons=2 and hinc< .8*(.8*(51000))
- or
- persons=5 and hinc< 1.08*(.8*(51000))
- or
- persons=6 and hinc< 1.16*(.8*(51000))
- );
- run;
- /*Total Number of Rows = 2702*/
- /*Get count of low income households based on listed conditions*/
- proc sql;
- select count(*) as N_Obs
- from NULI2
- where
- persons <= rooms
- and
- (smocapi<= 30 or grapi<=30);
- quit;
- /*N_Obs =2539*/
- /*Proportion : 2539/2702 = .939674 */
- /* ALL COLORADO */
- DATA colorado;
- SET project.g6oklcol;
- IF state=8;
- run;
- /*Total Number of Rows = 80732 */
- /* CALCULATE PROPORTION OF LOW INCOME FAMILIES */
- /* Get data with households that house a single family */
- DATA singlefamilyhht3;
- SET colorado;
- IF hht=1;
- run;
- /*Total Number of Rows = 43420 */
- /*median of single family household*/
- PROC MEANS data=singlefamilyhht3(where= (persons=4)) median;
- var hinc;
- weight hweight;
- run;
- /*Note median =68100*/
- /*Get count of low income households based on listed conditions*/
- proc sql;
- select count(*) as N_Obs
- from singlefamilyhht3
- where persons=4 and hinc<.8*(68100)
- or
- persons=3 and hinc< .9*(.8*(68100))
- or
- persons=2 and hinc< .8*(.8*(68100))
- or
- persons=5 and hinc< 1.08*(.8*(68100))
- or
- persons=6 and hinc< 1.16*(.8*(68100));
- quit;
- /*N_Obs =15516*/
- /*Proportion : 15516/43420 = .35735 */
- /* CALCULATE PROPORTION OF LOW INCOME, AFFORDABLE, AND NOT CROWDED AMONG NEW UNITS */
- DATA newunits3;
- SET colorado;
- IF yrbuilt=1
- or
- yrbuilt=2
- or
- yrbuilt=3;
- run;
- /*Total Number of Rows = 17020*/
- /*Get count of low income households based on listed conditions*/
- proc sql;
- select count(*) as N_Obs
- from newunits3
- where
- (persons=4 and hinc<.8*(68100)
- or
- persons=3 and hinc< .9*(.8*(68100))
- or
- persons=2 and hinc< .8*(.8*(68100))
- or
- persons=5 and hinc< 1.08*(.8*(68100))
- or
- persons=6 and hinc< 1.16*(.8*(68100))
- )
- and
- persons <= rooms
- and
- (smocapi<= 30 or grapi<=30);
- quit;
- /*N_Obs =4010*/
- /*Proportion : 4010/17020 = .23561 */
- /* CALCULATE PROPORTION OF AFFORDABLE AND NOT CROWDED AMONG NEW UNITS OCCUPIED BY LOW INCOME FAMILIES */
- DATA NULI3;
- SET colorado;
- where (yrbuilt=1
- or
- yrbuilt=2
- or
- yrbuilt=3)
- and
- (persons=4 and hinc<.8*(68100)
- or
- persons=3 and hinc< .9*(.8*(68100))
- or
- persons=2 and hinc< .8*(.8*(68100))
- or
- persons=5 and hinc< 1.08*(.8*(68100))
- or
- persons=6 and hinc< 1.16*(.8*(68100))
- );
- run;
- /*Total Number of Rows = 4340*/
- /*Get count of low income households based on listed conditions*/
- proc sql;
- select count(*) as N_Obs
- from NULI3
- where
- persons <= rooms
- and
- (smocapi<= 30 or grapi<=30);
- quit;
- /*N_Obs =3793*/
- /*Proportion : 4010/4340 = .92396 */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement