data FieldHistory; infile "Field History (Landscape Study).csv" dlm=',' firstobs=2; input Field $ Year Yr_Injury Location $ Corn NonBt Cry3 Cry3435 Pyr Cat FH1 FH2 FH4 FH5 FH6 FH7 FH8 FH10 FH11 FH12 Root WCR; sqrt_WCR=sqrt(WCR); sqrt_root=sqrt(root); run; proc print; run; proc corr; var NonBt Cry3 Cry3435 Pyr FH4 FH1 FH2 FH5 FH6 FH7 FH8 FH10 FH11 FH12; run; proc freq; tables NonBt*cat /chisq; tables Cry3*cat / chisq; tables Cry3435*cat / chisq; tables Pyr*cat / chisq; tables FH4*cat / chisq; run; proc sort; by cat; run; proc freq; tables NonBt Cry3 Cry3435 Pyr FH4; by cat; run; ods output summary=with_stackods; proc means stackodsoutput n mean stderr; var FH1 FH2 FH5 FH6 FH7 FH8 FH12; by cat; run; /* Is there a difference between FF and SURR fields in the field history metrics? */ /*total years continuous corn*/ proc mixed; class Cat location; model FH1a = Cat; random location location*cat; run; proc mixed; /*Final model*/ class Cat location; model FH1a = Cat; random location; run; proc mixed; class Cat location; model FH1a = Cat; run; /*Proportion corn planted in 6 yr*/ proc mixed; class Cat location; model FH2 = Cat; random location location*cat; run; proc mixed; class Cat location; model FH2 = Cat; random location; run; proc mixed; /*Final model*/ class Cat location; model FH2 = Cat; random location*cat; run; /* Proportion SI use in 6 yr */ proc mixed; class Cat location; model FH5 = Cat; random location location*cat; run; proc mixed; /*Final model*/ class Cat location; model FH5 = Cat; random location; run; proc mixed; class Cat location; model FH5 = Cat; run; /* Proportion non bt */ proc mixed; class Cat location; model FH6 = Cat; random location location*cat; run; proc mixed; /*Final Model*/ class Cat location; model FH6 = Cat; random location; run; proc mixed; class Cat location; model FH6 = Cat; run; /* Proportion Cr3Bb1 or mCry3a */ proc mixed; class Cat location; model FH7 = Cat; random location location*cat; run; proc mixed; /*Final Model*/ class Cat location; model FH7 = Cat; random location; run; proc mixed; class Cat location; model FH7 = Cat; run; /*Prop Cry3Bb1 or mCry3a was sig dif. Getting some means here*/ proc sort; by cat; proc means n mean stderr; var FH7; by cat; run; /* Proportion Cry34/35Ab1 */ proc mixed; class Cat location; model FH8 = Cat; random location location*cat; run; proc mixed; /*FINAL model*/ class Cat location; model FH8 = Cat; random location; run; proc mixed; class Cat location; model FH8 = Cat; run; proc mixed; class Cat location; model FH10 = Cat; random location location*cat; run; proc mixed; /*final model*/ class Cat location; model FH10 = Cat; random location; run; proc mixed; class Cat location; model FH10 = Cat; run; proc mixed; class Cat location; model FH11 = Cat; random location location*cat; run; proc mixed; class Cat location; model FH11 = Cat; random location; run; proc mixed; class Cat location; model FH11 = Cat; run; /*Prop SI on non Bt*/ proc mixed; class Cat location; model FH12 = Cat; random location location*cat; run; proc mixed; /*Final model*/ class Cat location; model FH12 = Cat; random location; run; proc mixed; class Cat location; model FH12 = Cat; run; /* DID ANY FIELD HISTORY METRICS AFFECT ROOT INJURY OR WCR ABUNDANCE? */ proc reg plots (only)=ALL; Model sqrt_WCR= NonBt Cry3 Cry3435 Pyr FH1 FH2 FH5 FH6 FH7 FH8 FH10 FH12 / selection=stepwise SLE=0.25 SLS=0.15 include=0; plot residual.*nqq.; run; proc reg plots (only)=ALL; Model sqrt_root= NonBt Cry3 Cry3435 Pyr FH1 FH2 FH5 FH6 FH7 FH8 FH10 FH12 / selection=stepwise SLE=0.25 SLS=0.15 include=0; plot residual.*nqq.; run;