****************************************************** * This file calculates catch for Chris Taylor's * * Croaker dataset. * * First segment sets up some options in the program.* ******************************************************; %let fish = Croaker; %let method=Ward; %let ncl=7; * # clusters ; %let stopplot = 20; * plot all after this together ; %let flname = G:\Pietrafesa\Miller\ChrisTaylor\Croaker_Dickey.csv; title h=1.2 "Lengths of Croaker, Chris Taylor Data"; footnote " Catch is really log(catch+1)"; proc format; value clus &stopplot ="All the rest"; proc greplay nofs; igout=work.gseg; delete _all_; ** clear out the existing graphics catalog ***; title " "; footnote " "; ************************************* * Input data * ************************************; Data a; input year1987 year1988 year1989 year1990 year1991 year1992 year1993 year1994 year1995 year1996 ; cards; 0.00000 0.00000 1.56862 0.00000 0.00000 0.00000 0.00000 0.91629 0.69315 0.00000 1.30833 0.00000 0.00000 0.00000 0.00000 0.69315 2.44235 0.00000 3.21888 0.00000 3.73050 4.80974 3.19048 3.78419 3.40120 4.06903 4.86368 1.09861 4.18965 0.69315 1.84055 1.38629 0.69315 2.35138 1.60944 2.07944 4.11087 2.52573 2.56495 0.00000 3.35690 2.33214 2.61740 3.96081 0.91629 0.00000 4.69135 3.70623 4.09434 0.40547 3.91801 2.75366 3.14845 2.70805 3.43399 2.70805 4.35286 3.62434 3.65066 1.87180 3.34286 2.98062 3.87120 4.15888 3.87120 4.89784 4.79165 4.13517 4.59512 3.89182 2.33214 1.94591 0.26236 1.70475 0.40547 0.00000 1.70475 0.00000 0.69315 0.00000 0.00000 1.30833 1.84055 3.17805 0.00000 0.00000 3.46574 0.91629 2.67415 0.00000 2.01490 1.54756 0.26236 0.00000 1.25276 0.91629 2.30259 2.80336 2.35138 3.11352 0.00000 0.00000 0.00000 0.00000 0.00000 4.24850 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.26236 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 1.45862 0.53063 0.53063 0.00000 0.00000 0.00000 0.00000 2.14007 0.00000 0.00000 1.38629 3.26957 2.07944 1.09861 1.38629 1.70475 0.00000 1.25276 2.35138 2.48491 1.19392 0.26236 4.27388 2.01490 0.00000 1.87180 2.70805 1.60944 2.14007 0.00000 1.25276 2.33214 2.73437 1.25276 0.69315 1.98787 1.09861 0.40547 1.70475 0.00000 1.09861 0.00000 2.23001 1.66771 1.30833 2.01490 0.40547 1.70475 0.00000 0.00000 2.81541 0.53063 1.09861 0.40547 1.60944 0.40547 1.09861 1.70475 1.60944 1.25276 0.69315 0.00000 0.00000 0.00000 0.00000 0.40547 1.25276 0.00000 0.40547 0.69315 7.35417 2.56495 4.26268 2.56495 1.60944 4.41280 3.04452 3.54096 2.39790 3.81771 4.96564 2.33214 2.63906 3.13549 2.74084 3.29584 4.67283 3.98898 5.47646 3.52636 7.48566 3.68135 0.00000 0.00000 1.94591 0.40547 1.09861 0.69315 3.87120 0.91629 4.64439 3.36038 2.33214 3.51155 4.75359 5.30579 4.80238 3.71357 5.17897 3.21888 5.70044 3.52046 2.66026 2.14007 1.79176 3.92790 3.25810 0.91629 4.99383 3.70130 2.45959 2.04122 0.83291 2.35138 3.40120 2.67415 3.25810 1.30833 2.91777 2.48491 3.57515 3.82210 1.30833 2.77259 3.38439 3.70130 5.75416 3.78419 3.21888 3.70130 0.53063 1.98787 1.30833 3.43399 1.09861 1.25276 3.04452 3.19867 3.92197 1.38629 1.54756 1.19392 0.00000 0.69315 0.00000 0.00000 2.80336 0.69315 2.60269 0.40547 3.01062 3.21888 3.16548 0.69315 2.44235 1.94591 4.02535 3.31419 2.56495 3.74950 3.45632 1.84055 2.99573 2.77259 2.67415 3.21888 4.43675 3.79549 3.02042 2.39790 0.99325 3.77735 0.53063 2.52573 1.38629 3.85015 3.41773 3.19867 3.36730 0.00000 2.94444 2.98062 0.53063 2.94444 2.52573 3.46574 3.46574 3.11352 3.55535 2.07944 2.48491 4.36945 0.83291 2.63906 1.09861 2.70805 4.18965 1.70475 3.04452 2.39790 1.90211 0.00000 0.00000 0.40547 0.00000 0.00000 3.09104 0.00000 2.86220 1.09861 0.00000 0.26236 0.00000 1.09861 0.69315 1.50408 2.56495 1.09861 2.99573 0.40547 2.19722 3.45632 0.00000 3.21888 1.70475 2.25129 3.09104 3.33220 4.63473 0.69315 1.90211 2.99573 0.53063 1.87180 1.09861 0.00000 4.61016 2.35138 3.44999 1.09861 3.24649 3.37759 1.54756 3.97968 0.91629 3.94158 2.97041 3.56953 4.74927 0.00000 0.99325 2.90690 0.69315 2.83321 0.40547 3.96081 3.66356 0.91629 3.70130 4.83628 3.80666 3.44362 0.69315 2.01490 0.69315 4.02535 5.15329 3.04452 3.49651 0.69315 3.36730 3.33220 3.40120 2.48491 2.77259 2.07944 3.93769 4.43082 4.00186 3.59731 3.77735 4.69135 3.76120 3.34990 3.19867 4.87137 4.21213 4.95583 5.02059 4.12713 3.48738 3.49651 0.53063 3.41773 0.00000 2.77259 2.70805 2.48491 3.94158 3.33220 2.16332 0.53063 0.00000 0.00000 0.00000 0.00000 2.30259 0.00000 2.56495 0.69315 2.79117 1.54756 2.27213 2.56495 0.00000 2.44235 3.04452 0.00000 1.25276 0.00000 3.56953 2.39790 0.69315 4.02535 1.09861 1.70475 3.66356 2.94444 2.30259 2.99573 3.39115 3.12676 2.37024 2.97041 2.30259 4.03424 3.90600 2.86220 4.04305 0.91629 0.00000 0.00000 0.00000 0.40547 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 0.26236 0.00000 0.00000 0.00000 0.00000 0.40547 0.00000 0.00000 0.00000 0.00000 2.39790 3.10459 1.66771 2.35138 1.60944 0.40547 2.52573 1.74047 1.25276 2.56495 2.30259 0.26236 1.09861 2.99573 1.60944 2.25129 2.25129 0.91629 1.30833 2.86220 2.27213 2.87356 3.20275 3.61092 1.50408 1.50408 4.23411 4.14313 3.27714 3.75420 0.91629 0.40547 0.00000 2.83321 0.00000 2.86220 0.69315 0.91629 0.00000 0.91629 2.56495 3.46574 3.64545 3.40120 1.70475 2.94444 3.41115 4.37576 4.43675 1.50408 3.70623 3.02529 4.41522 2.86220 2.60269 3.04452 3.34990 3.90600 3.97029 4.28359 3.37759 3.62966 2.89037 3.17805 2.25129 3.06805 3.77735 3.91801 3.17805 3.57795 3.30689 4.24850 3.68387 4.43082 1.50408 3.49651 3.54096 3.99820 3.13549 3.55535 5.37667 3.05871 3.43399 5.13285 1.70475 1.87180 3.63759 5.36598 3.33220 2.48491 1.09861 1.84055 1.60944 1.25276 0.69315 2.70805 1.50408 2.56495 3.13549 1.50408 3.95700 1.45862 2.37024 1.38629 1.94591 2.74084 1.50408 2.80336 3.31419 0.00000 3.79997 3.17805 4.48526 4.19720 0.40547 1.70475 4.45435 4.93447 3.02042 2.30259 2.68785 2.94444 3.41115 1.38629 0.91629 2.14007 2.44235 4.31749 2.39790 2.07944 1.90211 1.98787 3.46574 1.38629 1.38629 2.91777 1.38629 1.60944 3.11352 1.94591 3.30689 3.72569 2.33214 2.83321 3.09104 3.23868 4.02535 3.25810 2.25129 3.82864 4.90305 5.33609 4.29046 3.86073 2.25129 2.01490 4.61016 4.67749 4.88280 3.54096 3.34286 3.91202 0.69315 3.89182 2.83321 2.30259 4.56954 3.77276 4.25561 2.44235 4.50314 3.13549 1.19392 3.17805 2.89037 4.56435 4.11087 3.27714 5.65599 1.70475 2.79117 2.48491 0.00000 3.03013 1.09861 2.07944 4.59512 2.56495 3.65066 0.40547 4.25845 3.46574 1.09861 3.09104 0.00000 0.00000 4.39445 3.44999 3.33220 0.00000 4.11578 2.11626 0.83291 3.92197 1.09861 0.69315 5.14166 1.94591 4.28359 2.19722 4.61215 4.60116 2.50960 3.52636 3.02042 4.83231 4.01638 4.60517 2.91777 4.10264 2.39790 2.85071 0.53063 4.16821 3.66356 2.44235 4.26970 3.33220 4.10264 1.79176 3.37759 2.07944 0.99325 3.17805 1.79176 3.43399 5.13874 2.25129 3.67630 0.00000 2.48491 3.20680 2.83321 3.21888 1.94591 3.54096 5.10595 3.55535 4.52721 2.30259 3.40120 4.15888 2.66026 3.83945 3.27714 4.12713 4.83390 3.55535 4.80402 3.99820 2.61740 4.06560 2.37024 4.26268 2.19722 2.01490 3.86073 1.87180 4.18965 2.35138 2.07944 1.09861 0.99325 2.48491 1.79176 1.60944 4.61512 2.48491 3.12236 1.38629 1.94591 1.19392 0.99325 3.29584 2.35138 0.40547 4.05178 2.48491 0.00000 1.09861 0.00000 0.53063 0.26236 0.40547 0.40547 0.40547 0.00000 0.00000 0.00000 0.00000 0.53063 0.83291 1.45862 2.67415 1.25276 0.69315 3.78419 4.65396 2.67415 2.99573 1.94591 1.84055 0.26236 1.94591 2.25129 0.69315 3.66356 2.25129 1.50408 0.91629 . . . . 1.60944 0.00000 . 2.89037 1.94591 2.14007 2.86220 2.89037 1.38629 2.14007 1.38629 1.25276 3.99820 2.39790 2.63906 1.94591 1.25276 0.26236 0.26236 2.07944 0.40547 0.00000 3.09104 1.38629 0.40547 0.00000 0.26236 0.00000 0.69315 0.69315 2.39790 0.69315 3.25810 2.60269 2.39790 1.87180 0.26236 2.66026 2.11626 3.04452 1.09861 1.70475 0.00000 0.00000 0.91629 0.00000 4.41037 4.24850 3.19048 3.99820 2.30259 3.19867 0.69315 3.73767 2.30259 3.25810 1.38629 0.83291 3.21888 3.61092 0.69315 2.44235 3.89182 3.57515 3.71357 0.91629 1.30833 1.19392 2.19722 2.77259 0.00000 1.87180 3.61092 2.56495 4.07754 0.69315 3.61092 1.66771 3.23080 1.87180 3.44999 1.38629 1.87180 0.40547 2.19722 0.40547 3.93769 2.66026 4.09933 0.40547 2.23001 0.00000 1.38629 0.40547 0.00000 0.00000 0.00000 0.00000 0.53063 0.91629 0.40547 0.00000 0.40547 0.40547 1.09861 0.40547 0.53063 0.00000 0.00000 0.00000 0.00000 0.00000 0.40547 0.00000 0.00000 0.00000 5.82008 5.47646 3.81771 2.63906 3.58352 4.69135 6.70380 4.03424 6.42162 4.45435 5.97813 3.92197 5.41388 3.41773 3.09104 3.62434 5.61130 3.62434 . 4.79991 1.45862 0.00000 4.49200 0.00000 2.48491 2.39790 0.00000 . . 0.00000 5.11379 2.48491 2.85071 2.19722 2.52573 1.87180 2.89037 2.25129 2.30259 1.87180 0.53063 0.00000 3.32143 0.00000 3.67630 1.70475 0.00000 1.60944 1.50408 0.00000 2.74084 4.42245 3.68135 3.68888 1.50408 3.82864 4.96284 4.87520 4.11904 3.44999 3.13549 3.94546 . 2.25129 2.30259 3.33220 2.99573 3.89792 4.21213 2.39790 ; data b; input year1997 year1998 year1999 year2000 year2001 year2002 STATION $ lat long i ; cards; 0.00000 0.40547 0.91629 2.30259 0.00000 1.25276 46 34.7890 -76.6102 17 4.33073 4.65871 0.91629 4.62986 0.00000 1.70475 A12 35.3000 -76.6011 17 6.17274 6.30079 3.59731 5.61495 0.00000 4.79579 A2 35.3187 -76.6370 17 3.70130 4.35671 3.21888 3.62434 1.70475 1.50408 A58 35.3005 -76.5109 17 4.81218 6.07764 3.46574 4.99383 4.88658 5.20675 AB1 35.4067 -76.5079 17 4.77912 5.01064 4.15888 5.68698 3.74950 2.01490 B10 35.3146 -76.5010 17 4.55388 4.98018 3.80666 4.99043 3.72569 4.22683 B20 35.2641 -76.5018 17 4.26268 4.48300 0.00000 2.30259 0.00000 0.00000 B40 35.2401 -76.5914 17 1.94591 3.77276 2.25129 0.40547 0.00000 3.15700 B43 35.2149 -76.5718 17 2.89037 4.64439 3.33220 4.10264 3.68888 2.07944 BB4 36.0002 -75.6805 17 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 CB13 34.7721 -76.4236 17 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 CB17 34.7311 -76.4476 17 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 CC0 34.9773 -76.2665 17 0.00000 0.91629 1.25276 0.40547 0.00000 0.00000 CC10 34.9231 -76.3589 17 2.07944 3.51155 1.09861 2.30259 1.60944 2.25129 CC11 34.9499 -76.2892 17 0.91629 1.38629 0.99325 2.97041 0.83291 1.98787 CC3 34.7519 -76.7508 17 0.00000 2.35138 0.40547 2.83321 0.00000 1.79176 CC5 34.8181 -76.6229 17 0.40547 0.69315 0.40547 2.52573 1.38629 0.40547 CC6 34.8058 -76.4806 17 1.09861 0.40547 0.00000 0.00000 0.00000 0.69315 CC7 34.8251 -76.4577 17 0.00000 1.87180 0.00000 1.70475 0.00000 0.00000 CC9 34.9232 -76.4365 17 0.99325 3.51750 4.82270 3.04452 4.52504 5.24333 CFR1 34.2520 -77.9681 17 1.38629 1.60944 2.25129 3.04452 4.74057 2.83321 CFR11 33.9822 -77.9219 17 1.38629 0.00000 1.98787 0.00000 2.11626 2.19722 CFR2 34.2664 -77.9475 17 1.94591 2.72785 2.30259 2.48491 5.62762 2.86220 CFR4 34.1239 -77.9294 17 2.19722 5.35659 2.14007 2.80336 5.73334 1.50408 CFR5 34.1289 -77.9503 17 3.25810 4.15888 3.97968 3.19867 3.70130 3.87120 CN1 35.1765 -76.6749 17 4.67283 4.94521 4.46591 5.60027 4.55388 4.62986 CN14 35.1543 -76.7138 17 4.81624 4.64439 3.83945 4.27667 0.40547 3.91202 CN3 35.1954 -76.6209 17 2.83321 4.61512 2.39790 2.25129 0.40547 1.79176 CN6 35.2013 -76.5579 17 3.36730 2.99573 3.09104 4.68213 4.04305 0.69315 CR22 35.9418 -75.8088 17 2.83321 2.74084 2.52573 3.68888 2.01490 1.70475 CR23 35.8677 -75.7549 17 5.33513 4.01638 4.87137 2.99573 0.40547 3.56953 CS13 35.1454 -76.6669 17 5.61495 5.06260 5.29581 5.26269 1.79176 3.61092 CS2 35.1479 -76.6365 17 4.09434 4.69135 2.52573 3.78419 3.49651 4.90527 D03C 35.1904 -76.6446 17 1.94591 4.21213 3.21888 4.10264 0.00000 2.44235 D5 35.1384 -76.5944 17 3.59731 3.86073 2.44235 3.85015 0.00000 0.40547 D8 35.1569 -76.5689 17 5.22036 5.18459 2.39790 4.76217 1.38629 3.67630 E10 35.0824 -76.6580 17 3.51750 5.43590 2.19722 4.08598 0.69315 3.27714 E15 35.1093 -76.5859 17 4.78749 5.68188 0.69315 4.98361 2.63906 3.38439 F1 35.0631 -76.6452 17 4.09434 5.69373 0.00000 5.30579 0.40547 2.56495 F12 35.0380 -76.7236 17 4.97328 5.74140 1.09861 5.05306 2.14007 2.52573 F3N 35.0436 -76.6665 17 3.52636 4.89035 3.85015 4.44265 2.94444 3.02042 FC1 35.5122 -75.9863 17 4.80811 5.14166 4.79991 5.59657 3.95124 4.53796 FC3 34.3028 -77.7550 17 3.82864 3.40120 0.00000 4.89035 1.25276 1.38629 G14 34.9904 -76.5757 17 1.25276 3.93183 0.00000 4.17439 1.79176 0.00000 G16 34.9498 -76.5911 17 2.70805 3.38439 1.09861 2.63906 0.40547 0.00000 G19 34.9396 -76.6368 17 2.14007 4.02535 3.97029 3.77276 2.35138 2.07944 G3 34.9790 -76.5069 17 3.94158 4.20469 3.73767 4.77491 3.52636 2.90690 H2 34.8650 -76.7618 17 0.00000 0.00000 0.00000 0.40547 0.00000 0.00000 HAT1 35.2980 -75.5232 17 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 HAT4 35.2431 -75.6351 17 0.00000 0.00000 0.00000 0.00000 0.00000 0.00000 HAT8 35.2189 -75.7082 17 0.00000 2.39790 0.00000 0.00000 0.00000 0.00000 HI15A 35.6992 -75.5399 17 1.09861 3.31419 3.49651 2.07944 2.39790 2.14007 J10 34.9367 -76.4065 17 0.40547 2.70805 0.40547 2.74084 0.00000 0.00000 J2 34.9423 -76.4636 17 4.66344 4.60016 3.15700 3.82210 1.70475 3.38439 JB1 35.3910 -76.2550 17 3.80666 0.69315 0.40547 4.69135 2.35138 0.00000 KHB2 36.0341 -75.7038 17 3.46574 3.41773 3.59731 3.46574 0.00000 3.23868 LSR1 35.6241 -75.8644 17 3.12236 3.89182 2.83321 3.86073 1.79176 2.25129 LSR11 35.5494 -75.9225 17 3.23868 2.39790 1.60944 2.96011 3.56953 3.29584 LSR3 35.6014 -75.9034 17 4.19720 4.69135 3.68888 3.47507 4.14313 3.89182 LSR5 35.5979 -75.8180 17 2.70805 5.52744 3.23868 2.14007 0.91629 4.11087 NR1 34.7561 -77.4364 17 2.56495 3.17805 1.09861 3.79549 2.52573 3.51155 NR10 34.5933 -77.3983 17 1.38629 4.26268 1.60944 3.82864 1.70475 2.80336 NR13 34.6254 -77.4300 17 2.97041 5.23910 2.89037 4.49424 4.36945 3.19867 NR2 34.7381 -77.4264 17 0.00000 4.60817 1.79176 1.38629 4.73180 3.55535 NR4 34.7245 -77.3833 17 2.67415 3.43399 0.40547 3.89182 4.14313 4.68213 NR6 34.6364 -77.3308 17 4.59512 5.22305 5.42803 3.70130 3.88156 2.35138 OC1 34.4219 -77.5592 17 4.70502 0.00000 0.00000 3.40120 4.64919 3.66356 PAR11 35.3091 -76.7835 17 6.18002 4.73620 2.07944 4.84419 4.12713 3.70130 PAR13 35.3307 -76.6851 17 5.86505 5.67332 1.60944 5.63479 5.87493 4.45435 PAR16 35.3400 -76.6443 17 4.67283 5.28320 3.58352 4.36310 2.97041 3.40120 PAR20 35.4322 -76.6538 17 5.36831 5.11500 0.40547 4.96284 2.14007 4.21951 PAR27 35.3471 -76.7495 17 4.83628 0.69315 4.13836 4.26970 0.00000 3.54096 PAR31 35.3356 -76.7654 17 5.54322 4.00733 3.96081 2.01490 3.72569 4.86753 PAR7 35.3787 -76.8173 17 3.90197 4.01638 2.30259 3.31419 2.80336 2.89037 PAR8 35.4545 -76.8180 17 4.26268 4.48864 2.14007 4.06903 4.26970 3.76120 PAR9 35.4284 -76.7610 17 5.29079 5.97254 4.25561 5.40268 1.60944 2.97041 PUR3 35.4044 -76.5965 17 4.24133 5.16479 2.01490 3.68888 2.77259 3.31419 PUR34 35.4602 -76.6063 17 5.55024 5.80964 3.09104 4.47164 2.35138 3.33220 PUR5 35.4454 -76.5284 17 4.32413 5.30081 0.69315 4.57985 0.00000 3.06805 PUR7 35.4805 -76.5413 17 4.67749 6.22555 3.07731 4.77491 0.91629 4.06903 RB1 35.4417 -76.4315 17 3.06805 2.19722 0.00000 3.21888 0.00000 1.38629 RB3 35.4251 -76.4337 17 3.33220 4.59006 3.13549 4.43675 3.58352 1.60944 RI10 35.8993 -75.6585 17 1.60944 3.46574 1.25276 2.48491 3.06805 0.40547 RI11 35.8735 -75.6413 17 3.29584 4.41884 1.94591 4.06044 2.56495 0.91629 RI1A 35.9124 -75.6696 17 2.35138 2.99573 1.60944 3.38439 2.14007 0.69315 RI6 35.8200 -75.6219 17 0.40547 3.02042 1.09861 0.00000 1.25276 0.00000 RS2 35.8432 -75.6027 17 3.73767 4.87901 3.85015 4.08598 0.69315 2.70805 SB3 33.8578 -78.5424 17 3.58352 5.62942 2.63906 4.31749 2.89037 1.79176 SB5 33.8731 -78.5115 17 3.07731 2.80336 4.29046 4.18510 4.15104 2.63906 SPB1 35.6957 -75.7706 17 4.14313 5.14458 2.25129 3.82864 1.38629 3.04452 SQB1 35.4140 -76.3569 17 2.94444 4.06903 0.40547 2.99573 1.09861 0.00000 SQB3 35.3855 -76.3121 17 1.09861 3.06805 2.01490 0.40547 1.60944 2.30259 SR1 33.9556 -78.3636 17 1.25276 1.25276 1.25276 2.07944 0.69315 0.69315 SR12 33.9718 -78.3787 17 0.91629 0.00000 1.38629 0.00000 0.40547 0.40547 SR4 33.9336 -78.3622 17 0.00000 0.00000 0.40547 0.00000 0.00000 0.00000 SR9 33.9172 -78.3603 17 3.21888 4.67283 1.87180 4.12713 4.85203 2.74084 SSI1 34.5172 -77.4245 17 3.96081 4.39445 2.19722 4.87520 3.09104 2.77259 SSI6 34.5056 -77.4661 17 1.25276 2.56495 0.00000 0.40547 0.00000 2.35138 SSO11 34.4742 -77.4642 17 0.40547 1.09861 2.67415 0.91629 3.67630 0.69315 UCF1 34.2672 -77.9844 17 1.38629 2.67415 1.38629 0.40547 0.69315 0.40547 VC1 34.4314 -77.6056 17 4.19720 5.01396 3.46574 4.83231 3.49651 2.44235 WB1 34.2077 -77.8001 17 2.19722 . . 4.38203 0.40547 2.19722 WB3 34.2128 -77.7964 17 ; data &fish; merge a b; ***************************************** * Cluster the rows (locations) * *****************************************; proc cluster outtree=tree data=&fish method=&method; var year1987-year2002; id station; proc print data=tree; title2 "Clustering method: &method"; proc tree data=tree inc=1; height _ncl_; where _ncl_<30; run; *************************************************** * Plot the cubic clustering criterion * ***************************************************; proc gplot data=tree; plot _ccc_*_ncl_; where _ncl_ < 30; symbol1 v=dot i=needle; **************************************************** * Compute &ncl cluster solution & output clusters * * Dataset tree1 has cluster and location * ***************************************************; proc tree data=tree out=tree ncl=&ncl inc=1; height _ncl_; copy station; title3 "Using &ncl clusters"; run; proc gplot data=tree; plot cluster*station; symbol1 v=dot c=green i=none; data tree1; set tree; keep station cluster; proc sort data=tree1; by cluster; proc transpose data=tree1 out=tree2; var station; by cluster; data tree2; set tree2; drop _name_; proc print noobs; id cluster; title "Cluster List Using &method"; run; proc sort data=tree1; by station; proc sort data=&fish; by station; data all; merge &fish tree1; by station; if cluster ge &stopplot then cluster = &stopplot; format cluster clus.; proc sort data=all; by cluster station; proc transpose data=all out=big; by cluster station lat long; var year1987-year2002; data big; set big(rename=(col1=Catch)); year = substr(_name_,5,4); drop _name_; run; goptions reset=all; proc gplot uniform data=big; plot catch*year=station/nolegend; symbol1 v=none i=join r=20 w=2; by cluster; run; ********************************************** * Calculate and plot cluster centroids * **********************************************; proc means data=big nway; var catch; class cluster year; output out=john mean=mncatch std=std; title "Cluster Centroids"; data john; set john; yr=year + 0.0001; * make yr numeric **; data annoj; set john; xsys="2"; ysys="2"; when="B"; size=2; if cluster=1 or cluster=9 then color = "black "; if cluster=2 or cluster=10 then color= "red "; if cluster=3 or cluster=11 then color= "green "; if cluster=4 or cluster=12 then color= "blue "; if cluster=5 or cluster=13 then color= "cyan "; if cluster=6 or cluster=14 then color= "magenta"; if cluster=7 or cluster=15 then color = "gray "; if cluster=8 or cluster=16 then color = "yellow "; x = yr +.06*(cluster-4); function="move"; Y = mncatch + std; output; function = "draw" ; Y=mncatch-std; output; proc gplot annotate=annoj; plot mncatch*yr=cluster/haxis = 1986 to 2003 vaxis = -1 to 6; where cluster ne .; label yr="Year"; title2 "Cluster Centroids"; symbol1 v=none i=join; run; ******************************************************************* * Get the station coordinates and merge with clusters for graph.* * Compute (x,y) coordinates in tree1 data for annotate. * * Merge this with map of NC coastline data maps.states. * * Part variable distinguishes stations (part=1) from coastline * * map (part=.). * *******************************************************************; data stations; set big; length color $7.; long=-1*long; state=100; color="black"; proc sort; by station; title2 "Stations Data"; run; data tree1; merge tree1 stations; by station; part=1; x = long/180*(4*atan(1)); Y = lat/180*(4*atan(1)); data both; set tree1 maps.states; if state=37 or state=100; ********************************************** * Run GPROJECT to project coordinates * **********************************************; proc gproject data=both out=nccoast longmin=71 longmax=79 latmin=31 latmax=36.5; id state cluster; run; proc means; title2 "NCcoast data"; proc print data=nccoast; where cluster>15; run; ******************************************* * Greate ANNO data and check contents * ******************************************; /* data anno; set nccoast; xsys='2'; ysys='2'; style="special"; position='5'; hsys='1'; if part=1; text="J"; size=5; color="yellow"; if cluster=1 or cluster=10 then color="gray"; if cluster=2 or cluster=11 then color="cyan"; if cluster=3 or cluster=12 then color="brown"; if cluster=4 or cluster=13 then color="green"; if cluster=5 or cluster=14 then color="black"; if cluster=6 or cluster=15 then color="red"; if cluster=7 or cluster=16 then color="blue"; if cluster=8 or cluster=17 then color="tan"; if cluster=9 or cluster=18 then color="violet";*/ ** B&W version ; goptions colors=(black red green blue cyan magenta gray yellow);; data anno; set nccoast; length text $2.; xsys='2'; ysys='2'; function = "Label"; position='5'; * hsys='1'; if part=1; text=cluster; size = 1.5; style = "centB"; if cluster=. then text = "*"; if cluster ge &stopplot then text = "X"; if cluster=1 or cluster=9 then color = "black "; if cluster=2 or cluster=10 then color= "red "; if cluster=3 or cluster=11 then color= "green "; if cluster=4 or cluster=12 then color= "blue "; if cluster=5 or cluster=13 then color= "cyan "; if cluster=6 or cluster=14 then color= "magenta"; if cluster=7 or cluster=15 then color = "gray "; if cluster=8 or cluster=16 then color = "yellow "; f="centB"; proc means data=anno; proc print data=nccoast(obs=20); title2 "NC map data"; proc means data=nccoast; run; ******************************************* * Draw the map * *******************************************; data anno1; set anno; if cluster<5; Title "Clusters 1-4"; proc gmap map=nccoast data=nccoast all; id state; where part=.; choro state/nolegend annotate=anno1; pattern value=mempty repeat=7 color=blue; footnote " * = missing"; run; Title "Clusters 4-9 "; data anno2; set anno; if 4< cluster < 9; proc gmap map=nccoast data=nccoast all; id state; where part=.; choro state/nolegend annotate=anno2; pattern value=mempty repeat=7 color=blue; footnote " "; run; data anno1; set anno; if 9