options linesize=100 pagesize=100; libname revanch "c:\sasdat\revanch"; data revanch.citydat; infile "c:\sasdat\revanch\clusex.csv" delimiter=","; length fips $ 12; input fips $ city $ hchg78 hcgh89 hcgh90 pchg90 nhb9 hsp9 gq9 corr9 hless9 pov9 wpcapy9 wbratio9 own9 vac9 nhb0 hsp0 asn0 gq0 corr0 wdinks0 own0 ownchg90 wrent0 brent0 vac0 vacgh90; run; proc standard data=revanch.citydat mean=0 std=1 out=revanch.citystd; var hchg78 hcgh89 hcgh90 pchg90 nhb9 hsp9 gq9 corr9 hless9 pov9 wpcapy9 wbratio9 own9 vac9 nhb0 hsp0 asn0 gq0 corr0 wdinks0 own0 ownchg90 wrent0 brent0 vac0 vacgh90; run; proc factor data=revanch.citydat method=principal nfactors=6 rotate=varimax out=revanch.scores; var hcgh90 pchg90 nhb9 hsp9 gq9 corr9 hless9 pov9 wpcapy9 wbratio9 own9 vac9 nhb0 hsp0 gq0 corr0 wdinks0 own0 wrent0 brent0 vac0; title "revised, rotated principal components analysis"; run; proc cluster data=revanch.scores method=ward ccc pseudo print=30; var factor1 factor2 factor3 factor4 factor5 factor6; id fips; title "ward's analysis to determine number of clusters"; run; proc fastclus data=revanch.scores drift maxiter=500 maxclusters=12 out=revanch.trctclus; var factor1 factor2 factor3 factor4 factor5 factor6; id fips; title "final tract classifications, 12 clusters"; run; proc contents data=revanch.trctclus; run; proc freq data=revanch.trctclus; tables cluster*city; title "gentrification type by city"; run; proc sort data=revanch.trctclus; by cluster distance; run; proc print data=revanch.trctclus; var cluster distance fips city hcgh90 pchg90 nhb9 hsp9 gq9 corr9 hless9 pov9 wpcapy9 wbratio9 own9 vac9 nhb0 hsp0 gq0 corr0 wdinks0 own0 wrent0 brent0 vac0; run; proc means data=revanch.trctclus; var hcgh90 pchg90 nhb9 hsp9 gq9 corr9 hless9 pov9 wpcapy9 wbratio9 own9 vac9 nhb0 hsp0 gq0 corr0 wdinks0 own0 wrent0 brent0 vac0; by cluster; run; data revanch.visclus; set revanch.trctclus; length color $ 15; if cluster=1 then color="red"; if cluster=3 then color="blue"; if cluster=5 then color="yellow"; if cluster=9 then color="green"; if cluster=12 then color="magenta"; if cluster=2 then color="white"; if cluster=4 then color="white"; if cluster=6 then color="white"; if cluster=7 then color="white"; if cluster=8 then color="white"; if cluster=10 then color="white"; if cluster=11 then color="white"; run; goptions cback=black colors=(white white magenta yellow green); title1 "Classification of Gentrified Tracts"; proc g3d data=revanch.visclus; scatter factor1*factor2=factor3/ color=color; label factor1="segregation" factor2="redevelopment" factor3="tenure"; footnote color=red "cluster 1 " color=blue "cluster 3 " color=yellow "cluster 5 " color=green "cluster 9 " color=magenta "cluster 12 " color=white "outliers " ; run; proc g3d data=revanch.visclus; scatter factor2*factor3=factor4/ color=color; label factor2="redevelopment" factor3="tenure" factor4="institutions"; footnote color=red "cluster 1 " color=blue "cluster 3 " color=yellow "cluster 5 " color=green "cluster 9 " color=magenta "cluster 12 " color=white "outliers " ; run; proc g3d data=revanch.visclus; scatter factor3*factor4=factor5/ color=color; label factor3="tenure" factor4="institutions" factor5="latinos"; footnote color=red "cluster 1 " color=blue "cluster 3 " color=yellow "cluster 5 " color=green "cluster 9 " color=magenta "cluster 12 " color=white "outliers " ; run; proc g3d data=revanch.visclus; scatter factor4*factor5=factor6/ color=color; label factor4="institutions" factor5="latinos" factor6="inequality"; footnote color=red "cluster 1 " color=blue "cluster 3 " color=yellow "cluster 5 " color=green "cluster 9 " color=magenta "cluster 12 " color=white "outliers " ; run;