/*Read in the median dates */ data mediandates; length type $ 40; input Type $ begindate enddate; midpoint=(enddate+begindate)/2; span= enddate-begindate; invarwt= 1/((span/6)**2); keep type midpoint invarwt; cards; BlackonWhite 1175 1350 GlazeARed 1315 1425 GlazeAYellow 1315 1425 GlazeB 1400 1450 GlazeC 1425 1490 GlazeD 1490 1515 GlazeE 1515 1650 GlazeF 1625 1700 ; /* American_Stoneware 1750 1920 Creamware 1762 1820 Pearlware 1775 1830 White_Salt_Glaze 1720 1805 Porcelain__Chinese 1660 1860 Redware 1700 1900 Refined_Earthenware__unidentifia 1762 1830 Astbury_Type 1725 1750 Stoneware__unidentifiable . . Westerwald_Rhenish 1650 1775 Whieldon_type_Ware 1740 1775 Delftware__Dutch_British 1607 1802 Nottingham 1683 1810 Staffordshire_Mottled_Glaze 1680 1780 Slipware__North_Midlands_Staffor 1670 1795 Coarse_Earthenware__unidentifiab . . British_Stoneware 1671 1800 Fulham_Type 1671 1775 Jackfield_Type 1740 1790 Colonoware . . Buckley 1720 1775 */ ; proc sort; by type; proc transpose data=smoothx out=smoothxT(rename=col1=count) name=type; by quadratid; var _numeric_; proc print; run; proc sort data=smoothxT; by type; data both; merge smoothxT mediandates; by type; wt= count*invarwt; proc print; run; proc summary data=both; class quadratid; var midpoint; weight wt; output out=meandates mean(midpoint)=MeanCeramicDate ; data meandates; set meandates; if _type_ ne 0; drop _type_ ; proc sort data=ca_obs; by quadratid; proc sort data=meandates; by quadratid; data dates; merge ca_obs meandates; by quadratid; symbol1 color=black value=dot color=orange pointlabel =("#quadratid" font="garamond" h=2); proc gplot data=dates; plot meanceramicdate*dim1 / haxis=axis2 vaxis=axis1; *plot the scores; axis1 offset=(2,2) label=(angle=90 'MCD') major=(height=2) minor=(height=1) width=2; axis2 offset=(2,2) label= ('Dimension 1' ) major=(height=2) minor=(height=1) width=2; proc corr kendall; var meanceramicdate; with dim1 dim2; run;