options nodate nonumber ps=500 ls=76; data one; retain brandnum 0; infile 'winwine.dat' lrecl=218; input brand $ 1-25 price score01-score23; brandnum=brandnum+1; if brandnum<=5 then do; color=1; type=1; end; else if brandnum <=10 then do; color=2; type=1; end; else if brandnum <=15 then do; color=1; type=2; end; else if brandnum <=20 then do; color=2; type=2; end; cprice=price-9.464; score=score01; output; score=score02; output; score=score03; output; score=score04; output; score=score05; output; score=score06; output; score=score07; output; score=score08; output; score=score09; output; score=score10; output; score=score11; output; score=score12; output; score=score13; output; score=score14; output; score=score15; output; score=score16; output; score=score17; output; score=score18; output; score=score19; output; score=score20; output; score=score21; output; score=score22; output; score=score23; output; drop score01-score23; * brandnum=brandnum+1; /* do rater=1 to 3; input winescr @@; output; end; */ run; proc sort; by brandnum; data two; set one; by brandnum; retain rater; if first.brandnum then rater=0; rater=rater+1; run; /* proc print; run; */ quit; proc means n mean var; var score; run; proc means n mean var; class brandnum; var score; run; quit; proc mixed cl; * class brandnum; model score= price / ddfm=satterth solution; run; proc mixed cl; class color; model score= price color/ ddfm=satterth solution; run; proc mixed cl; class color type; model score= price color type(color)/ ddfm=satterth solution; run; proc mixed cl; class color brandnum; model score= price color brandnum(color)/ ddfm=satterth solution; run; proc mixed cl; class brandnum; model score= brandnum / ddfm=satterth solution; run; proc sort; by rater color type; run; proc mixed cl; class rater; model score= cprice / ddfm=satterth solution; random int / solution cl subject=rater; run; proc mixed cl; class color brand rater; model score= color cprice / ddfm=satterth solution; random int / solution cl type=un subject=rater; run; proc mixed cl; class color brand rater; model score= color cprice / ddfm=satterth solution; random color / solution cl subject=rater type=un; run; proc mixed cl; class color type brand rater; model score= color type(color) cprice / ddfm=satterth solution; random int / solution cl subject=rater; run; proc mixed cl; class color type brand rater; model score= color type(color) cprice / ddfm=satterth solution; random color / solution cl subject=rater type=un ; run; proc sort; by rater brandnum; proc mixed cl; class brandnum rater color; model score= color brandnum(color) / ddfm=satterth solution; random int / solution cl subject=rater ; run; proc mixed cl; class brandnum rater color; model score= brandnum / ddfm=satterth solution; random color / solution cl subject=rater type=un; run; proc mixed cl; class brandnum rater; model score= brandnum / noint ddfm=satterth solution; random int / solution cl subject=rater ; lsmeans brandnum / pdiff; run; quit; quit;