PROC IMPORT OUT= WORK.house DATAFILE= "H:\Courses\SpatialAnalysis\ArcGISExamples\LizData \house.dbf" DBMS=DBF REPLACE; GETDELETED=NO; RUN; PROC IMPORT OUT= WORK.small DATAFILE= "H:\Courses\SpatialAnalysis\ArcGISExamples\LizData\small_st.DBF" DBMS=DBF REPLACE; GETDELETED=NO; RUN; /*fix the missing value issue */ data house; set house; diam=DIAM__M__E; if DIAM__M__E = 0 then diam=.; goptions reset=global gunit=in ftitle="garamond" ftext="garamond" htitle=.2 htext=.1; symbol1 interpol=join c=orange w=5; symbol2 value=circle c=black h=.1; proc kde data=smallst; bivar point_y (bmw=1) point_x (bmw=1) / bistats unistats out=kde; run; /* create a file for use with ANNOTATE option to map house locations*/ data smallsites; set smallst; y=point_y; x=Point_x; FUNCTION='SYMBOL'; COLOR='BLACK'; size= (DIAM__M__E+1)*.5; text='CIRCLE'; XSYS='2'; YSYS='2'; OUTPUT; /*make the contour map and annotate it with the house locations */ proc gcontour data = kde; plot value1* value2= density / nlevels=20 llevels = 3 3 3 3 3 3 3 3 3 3 1 1 1 1 1 1 1 1 1 1 1 anno=housesites; run; /*create ASCII output files for programita*/ /* the house data */ data house; set house; point_y = 8322000-point_y; proc sort data =house; by point_x; proc summary data=house print;; var point_x point_y; output out=stats min(point_y) =miny max(point_y)=maxy min(point_x)=minx max(point_x)=maxx n(point_y) =n; run; data houseout; set stats house; data _null_; set houseout; file 'H:\Courses\SpatialAnalysis\datasets\house.dat'; var1=1; var2=0; if _n_= 1 then put minx maxx miny maxy n; if _n_=2 then do; put #2 point_x Point_y var1 var2; end; if _n_>=3 then put point_x Point_y var1 var2; run; /*The small str data */ proc summary data=smallst; var point_x point_y; output out=stats min(point_y) =miny max(point_y)=maxy min(point_x)=minx max(point_x)=maxx n(point_y) =n; data smallstout; set stats smallst; data _null_; set smallstout; file 'H:\Courses\SpatialAnalysis\datasets\smallst.txt'; var1=1; var2=0; if _n_= 1 then put minx maxx miny maxy n; if _n_=2 then do; put #2 point_x Point_y var1 var2; end; if _n_>=3 then put point_x Point_y var1 var2; run;