options ls=78; title "MANOVA - Pottery Data"; data pottery; infile "D:\Statistics\STAT 505\data\pottery.csv" delimiter=',' firstobs=2; input site $ al fe mg ca na; run; proc print data=pottery; run; /* The class statement specifies the categorical variable site. * The model statement specifies the five responses to the left * and the categorical predictor to the right of the = sign. */ proc glm data=pottery; class site; model al fe mg ca na = site; /* The contrast statements are used to calculate test statistics * and p-values for combinations of the groups. * The initial strings in quotes are arbitrary names, * followed by the name of the categorical variable defining the * groups, and the coefficients multiplying each group mean. */ contrast 'C+L-A-I' site 8 -2 8 -14; contrast 'A vs I ' site 1 0 -1 0; contrast 'C vs L ' site 0 1 0 -1; /* The estimate statements are used to calculate estimates and * standard errors for combinations of the groups. * The divisor option divides the contrast by the value specified. */ estimate 'C+L-A-I' site 8 -2 8 -14/ divisor=16; estimate 'A vs I ' site 1 0 -1 0; estimate 'C vs L ' site 0 1 0 -1; /* The lsmeans option provides standard error estimates and * standard errors for the differences between the site groups. * The manova statement is used for multivariate tests and results. * The h= option specifies the groups for comparison, and the * options printe and printh display the sums of squares and cross * products matrices for error and the hypothesis, respectively. */ lsmeans site / stderr; manova h=site / printe printh; run;