/* grapefruit1.sas */ title "Oneway ANOVA with repeated measures"; title2 'Grapefruit data (Applied linear statistical models, 5th ed., Prob 27.6)'; data grape1; infile '/folders/myfolders/441s18/Lecture/grapefruit1.data.txt' firstobs=2; input store sales1-sales3; label sales1 = 'Sales at Price 1' sales2 = 'Sales at Price 2' sales3 = 'Sales at Price 3'; d12 = sales1-sales2; d13 = sales1-sales3; d23=sales2-sales3; proc means n mean stddev maxdec=3; var sales1-sales3; run; proc reg plots=none; title3 'Test H0: mu1=mu2=mu3 with proc reg'; model d12 d13 = ; Price: mtest intercept=0; run; /* Linear combinations of response variables can be specified within proc reg rather than in the data step. */ quit; /* Weird that quit is needed for ods select to work, this time. */ ods select MultStat; proc reg plots=none; title3 'Specifying linear combinations within proc reg'; model sales1 sales2 sales3 = ; Price: mtest intercept=0, sales1-sales2, sales2-sales3; run; proc glm; title3 'Test H0: mu1=mu2=mu3 with proc glm'; model sales1-sales3 = ; repeated price / short summary mean; run; /* ods select MultStat; works with no quit, this time. */ proc means mean t probt maxdec=3; title3 'Pairwise matched t-tests'; var d12 d13 d23; run;