data gpf.milkcs1; format type $3.; infile 'c:\Documents and Settings\uzivatel\Dokumenty\genetickeparametry2003\mlkcs1/meanvariances2.milk'lrecl=160 missover; INPUT v1 V2; poradi=_n_; if poradi<79 then type='G'; if poradi>156 then type='REZ'; if poradi ge 79 and poradi le 156 then type='PE'; run; ************************ heritability; ************************ *PRIPRAVA DAT; data gE; set gpf.milkcs1; if type='G'; keep v1; RUN; *PRIPRAVA DAT; data PE; set gpf.milkcs1; if type='PE'; keep v1; RUN; data RE; set gpf.milkcs1; if type='REZ'; keep v1; Proc IML; *matice - vstup; ***********************************************; *ADDITIVE Genetic (co)variance matrix; ***********************************************; /* begin IML session */ use GE; v=j(1); G=j(12); i=0; DO j=1 to 12 ; /* begin do loop */ DO k=j to 12 ; read next into v; if j = k then do; G[j,j]=V[1,1]*1000000; end; else do; G[j,k]=V[1,1]*1000000; G[k,j]=V[1,1]*1000000; end; end; end; print G; ***********************************************; *PERMANENT environmental (co)variance matrix; ***********************************************; use PE; v=j(1); P=j(12); i=0; DO j=1 to 12 ; /* begin do loop */ DO k=j to 12 ; read next into v; if j = k then do; P[j,j]=V[1,1]*1000000; end; else do; P[j,k]=V[1,1]*1000000; P[k,j]=V[1,1]*1000000; end; end; end; print P; ***********************************************; *RESIUUM variance matrix; ***********************************************; /* begin IML session */ use RE; v=j(1); R=j(12,1); i=0; DO j=1 to 12 ; /* begin do loop */ read next into v; R[j]=V[1,1]*1000000; END; print R; quit;