options nocenter ls=130 ps=600; data a; infile 'ash.dat' missover; input cow week stage age trt herd milk fat prot scc lscore clin milkloss x14-x23; if fat=0 then fat=.; if prot=0 then prot=.; if scc=0 then scc=.; if lscore=0 then lscore=.; data b; infile 'marsh.dat' missover; input cow week stage age trt herd milk fat prot scc lscore clin milkloss x14-x23; if fat=0 then fat=.; if prot=0 then prot=.; if scc=0 then scc=.; if lscore=0 then lscore=.; data all; set a b; season = 'w '; /* 4 */ if 5<=week<=16 then season = 'sp'; /* 1 */ if 17<=week<=29 then season = 'sm'; /* 2 */ if 30<=week<=41 then season = 'f '; /* 3 */ lscore= ((log(scc/100)) / (log(2))) + 3; proc sort; by age herd trt cow season; proc means noprint; by age herd trt cow season; var milk--lscore stage; output out = means mean = milk fat prot scc lscore stage; proc print; var age herd trt cow season milk fat prot scc lscore stage;