/* filename: code051403.txt directory: C:\Documents and Settings\John Bailer\My Documents\baileraj\Classes\Fall 2003\SAS-programs Swim test data generated by S. Roark – pgm from B. Noble and K. See Variables: gpif gpis pgmf pgms ldhs <- genotypes hlwi <- some kind of hetro-loci overlap measure (disregard this variable) predis <- pre treatment swim distance postdis <- post treatment swim distance delta <- pre - post supp <- suppliers sex <- 1 male, 0 female */ options ls=178 formdlim='-' nodate pageno=1 ps=2000; data d1; input gpif gpis pgmf pgms ldhs hlwi predis postdis delta supp sex; cards; 22 22 13 33 12 0.4 209.016 114.216 94.8 1 1 22 22 13 23 11 0.4 103.536 0 103.536 1 1 22 22 12 33 11 0.2 174.576 115.056 59.52 1 1 22 22 13 13 11 0.4 114.72 46.44 68.28 1 1 23 33 22 33 12 0.4 154.128 122.28 31.848 1 1 22 22 13 13 11 0.4 158.64 18.576 140.064 1 1 23 22 23 33 11 0.4 159.12 161.904 -2.784 1 1 23 22 23 33 12 0.6 114.216 82.368 31.848 1 1 23 22 13 33 13 0.6 115.644 7.128 108.516 1 1 23 22 13 23 12 0.8 113.376 159.024 -45.648 1 1 22 22 23 33 11 0.2 160.848 157.296 3.552 1 1 22 22 13 23 12 0.6 128.16 74.52 53.64 1 1 23 22 12 33 12 0.6 149.58 120.264 29.316 1 1 33 23 13 13 12 0.8 81.072 70.5 10.572 1 1 22 23 12 33 12 0.6 80.496 116.064 -35.568 1 1 12 22 23 33 11 0.4 135.72 149.832 -14.112 1 1 22 22 22 23 11 0.2 128.328 75.816 52.512 2 1 22 23 11 33 11 0.2 122.112 83.016 39.096 2 1 22 22 23 33 11 0.2 76.176 51.9 24.276 2 1 22 23 22 13 11 0.4 156.816 88.632 68.184 2 1 22 12 12 33 12 0.6 205.128 0.864 204.264 2 1 23 23 11 13 12 0.8 154.416 160.848 -6.432 2 1 22 33 22 13 12 0.4 153.744 88.272 65.472 2 1 22 22 23 23 11 0.4 159.984 137.4 22.584 2 1 22 22 13 33 11 0.2 157.2 79.56 77.64 2 1 22 23 13 33 11 0.4 128.244 85.464 42.78 2 1 22 23 22 12 11 0.4 103.536 84.024 19.512 3 1 23 22 22 12 11 0.4 168.72 50.28 118.44 3 1 22 22 22 13 12 0.4 168.144 153.84 14.304 3 1 22 22 23 33 11 0.2 159.12 152.688 6.432 3 1 22 22 13 33 11 0.2 169.2 123.204 45.996 3 1 22 22 12 33 11 0.2 129.336 69 60.336 3 1 33 12 23 13 11 0.6 139.584 166.032 -26.448 3 1 33 22 23 13 11 0.4 205.344 124.464 80.88 3 1 23 22 12 11 12 0.6 157.008 110.604 46.404 3 1 23 12 23 13 11 0.8 159.888 9.18 150.708 3 1 22 23 12 11 11 0.4 161.616 115.056 46.56 3 1 22 22 22 33 11 0 156.816 129.42 27.396 3 1 33 23 23 13 11 0.6 152.4 49.26 103.14 3 1 22 22 13 33 11 0.2 159.792 153.168 6.624 3 1 22 23 23 11 11 0.4 159.6 110.52 49.08 3 1 22 22 22 13 11 0.2 171.6 264.48 -92.88 3 1 22 22 23 33 12 0.4 112.62 0 112.62 1 0 22 22 33 33 11 0 114.216 154.32 -40.104 1 0 23 22 23 33 12 0.6 87.264 128.916 -41.652 1 0 22 22 13 13 11 0.4 87.48 83.952 3.528 1 0 22 22 12 33 13 0.4 72.216 57 15.216 1 0 33 23 23 33 12 0.6 133.704 84.096 49.608 1 0 22 22 23 33 11 0.2 205.344 112.704 92.64 1 0 22 22 23 33 12 0.4 126.9 34.464 92.436 1 0 23 23 13 33 12 0.8 76.176 0.72 75.456 1 0 23 22 33 33 12 0.4 112.872 28.8 84.072 1 0 22 22 13 33 12 0.4 112.2 60.84 51.36 1 0 22 22 11 23 11 0.2 118.08 126.9 -8.82 1 0 22 22 11 23 12 0.4 89.28 0 89.28 1 0 23 22 13 13 12 0.8 112.62 117.996 -5.376 1 0 22 23 22 33 11 0.2 115.056 55.26 59.796 1 0 22 22 12 13 11 0.4 153.84 93.096 60.744 2 0 22 22 23 23 12 0.6 83.52 78.12 5.4 2 0 22 22 12 33 11 0.2 118.92 79.128 39.792 2 0 22 22 12 33 11 0.2 118.584 111.528 7.056 2 0 23 22 22 12 12 0.6 89.424 87.624 1.8 2 0 23 23 23 23 11 0.8 85.104 137.4 -52.296 2 0 22 22 12 33 12 0.4 74.736 80.136 -5.4 2 0 23 22 12 13 12 0.8 113.292 63.24 50.052 2 0 22 22 22 33 11 0 129.252 81.936 47.316 2 0 23 22 22 13 11 0.4 122.952 161.04 -38.088 2 0 23 22 12 23 11 0.6 161.328 113.628 47.7 2 0 22 22 12 33 12 0.4 118.164 84.456 33.708 2 0 22 22 22 33 11 0 113.292 110.604 2.688 2 0 22 22 23 23 12 0.6 156.72 116.4 40.32 2 0 22 22 23 12 11 0.4 69.78 113.88 -44.1 2 0 23 22 12 11 12 0.6 163.728 128.916 34.812 3 0 22 22 23 11 11 0.2 179.28 101.088 78.192 3 0 33 22 13 33 11 0.2 171.6 46.74 124.86 3 0 22 22 23 13 11 0.4 141.012 21.552 119.46 3 0 23 22 12 13 12 0.8 155.088 71.28 83.808 3 0 22 22 23 11 11 0.2 114.636 47.28 67.356 3 0 22 22 22 11 12 0.2 156.72 88.128 68.592 3 0 33 22 22 13 12 0.4 137.568 114.3 23.268 3 0 22 22 13 11 11 0.2 117.912 83.664 34.248 3 0 33 22 23 13 12 0.6 165.648 93.6 72.048 3 0 22 22 23 33 11 0.2 119.928 124.884 -4.956 3 0 22 22 12 13 11 0.4 143.364 79.704 63.66 3 0 12 22 12 13 11 0.6 145.128 79.56 65.568 3 0 ; run; %macro looper; %let rsp = %str(gpif,gpis,pgmf,pgms,ldhs); %let loci = %str(11,12,13,22,23,33); %do i = 1 %to 5; %do j = 1 %to 6; %let y = %scan(&rsp,&i,','); %let id = %scan(&loci,&j,','); data d2; set d1; if &y = &id then v=1; else v=0; run; title1 "Response: &y, Loci: &id"; title2 "Pre-Exposure Analysis"; proc genmod data=d2; class sex supp; model v = predis sex supp / link=logit dist=bin; run; title2 "Post-Exposure Analysis"; proc genmod data=d2; class sex supp; model v = postdis sex supp / link=logit dist=bin; run; title2 "Delta Analysis"; proc genmod data=d2; class sex supp; model v = delta sex supp / link=logit dist=bin; run; %end; %do k = 1 %to 3; data d3; set d2; t = int(&id/10); u = &id - 10*t; v = 0; if t = &k then v=1; if u = &k then v=0; run; title1 "Response: &y, modeling occurances of &k, Pre-exposure"; proc genmod data=d3; class sex supp; model v = predis sex supp / link=logit dist=bin; run; title1 "Response: &y, modeling occurances of &k, Post-exposure"; proc genmod data=d3; class sex supp; model v = postdis sex supp / link=logit dist=bin; run; title1 "Response: &y, modeling occurances of &k, Delta"; proc genmod data=d3; class sex supp; model v = delta sex supp / link=logit dist=bin; run; %end; title1 ""; title2 ""; run; %end; %mend; %looper title1; title2; proc glm data=d1; class sex supp; model hlwi = predis sex supp / ss3; run; proc glm data=d1; class sex supp; model hlwi = postdis sex supp / ss3; run; proc glm data=d1; class sex supp; model hlwi = delta sex supp / ss3; run; title1; title2; proc genmod data=d1; class sex supp gpif gpis pgmf pgms ldhs; model predis = gpif gpis pgmf pgms ldhs sex supp / dist=g link=log; contrast "11-12" ldhs 1 -1 0; contrast "11-13" ldhs 1 0 -1; contrast "12-13" ldhs 0 1 -1; run; proc genmod data=d1; class sex supp gpif gpis pgmf pgms ldhs; model postdis = gpif gpis pgmf pgms ldhs sex supp / dist=g link=log; lsmeans gpif gpis pgmf pgms ldhs / diff; run; proc genmod data=d1; class sex supp gpif gpis pgmf pgms ldhs; model delta = gpif gpis pgmf pgms ldhs sex supp / dist=g link=log; lsmeans gpif gpis pgmf pgms ldhs / diff; run; proc genmod data=d1; class sex supp hlwi; model predis = hlwi sex supp / dist=g link=log; run; proc genmod data=d1; class sex supp hlwi; model postdis = hlwi sex supp / dist=g link=log; run; proc genmod data=d1; class sex supp hlwi; model delta = hlwi sex supp / dist=g link=log; run;