/***********************************************************************/ /* SASQuant1.2 - By Gusmini, Wehner, Donaghy */ /* Genetic Estimates for Quantitative Traits */ /* */ /* The user needs to create a dataset called "Data.dat". */ /* The dataset should have the following columns: */ /* Plot number, set number, family number, generation number */ /* followed by columns of ratings, one per trait measured. */ /* */ /* Generation numbers should be as follows: */ /* Parent A = 01 */ /* Parent B = 02 */ /* (A X B) F1 = 03 */ /* (A X B) F2 = 04 */ /* (F1 X A) BC1A = 05 */ /* (F1 X A) BC1B = 06 */ /* */ /* The user needs to modify further statements at the end of the */ /* to customize the analysis. */ /***********************************************************************/ %macro dist(hovtest=bartlett); %let outhov=bartlett; %if %upcase(&hovtest) ne BARTLETT %then %let outhov=hovftest; %put outhov = &outhov; title5 "Distribution of F2 data by &byvar"; proc chart data=sub; by &byvar; vbar &dep; quit; ods listing close; ods output &outhov(match_all=macvar persist=proc)=_hov; proc glm data=sub; class Set; model &dep = Set; means Set / hovtest=&hovtest; proc glm data=sub; class Family; model &dep = Family; means Family / hovtest=&hovtest; proc sort data=sub out=_set; by Family; proc glm data=_set; by Family; class Set; model &dep = Set; means Set / hovtest=&hovtest; proc sort data=sub out=_set; by Set; proc glm data=_set; by Set; class Family; model &dep = Family; means Family / hovtest=&hovtest; quit; ods output close; ods listing ; data _allhov; length Source $8; set &macvar; if source='Error' then delete; proc sort data=_allhov(drop= _proc_ _run_ effect); by dependent &byvar; title5 "Homogenity of Variance Test - %upcase(&hovtest)"; proc print data=_allhov label; id dependent &byvar; label ProbChiSq='Probability > ChiSq'; label ProbChiSq='Probability'; proc datasets library=work nolist; delete _set _allhov &macvar / memtype=data; run; %mend dist; title 'SASQuant1.1 - By Gusmini, Wehner, Donaghy'; title3 'Genetic Estimates for Quantitative Traits'; title4 ' '; options pageno=1 nodate; /***********************************************************************/ /* The user needs to modify the following lines as indicated below: */ /* */ /* %let dep=trait1 trait2; */ /* input plot $ Set $ Family $ gen $ trait1 trait2; */ /* Modify the list traits to be analyzed. */ /* */ /* infile 'Data.dat' missover; */ /* Modify the name of the data file, if different. */ /* */ /* %let byvar=Set Family; */ /* Modify the list of blocking factors to be used */ /* for the analysis as follows: */ /* Set = blocking families by Set */ /* Family = blocking sets by family */ /* Set Family = no blocking */ /***********************************************************************/ %let dep=trait1 trait2; %let byvar=Set Family; data dst1; infile 'Data.dat' missover; input Plot $ Set $ Family $ Gen $ trait1 trait2; proc sort data=dst1; by &byvar; data dst1a; set dst1; where gen='04'; data sub; set dst1a; /***********************************************************************/ /* The user needs to modify the following lines as indicated below: */ /* */ /* To analyze data for a sub-set of the original dataset: */ /* 1. Uncomment the IF FAMILY IN... statement by deleting the *. */ /* The * will be needed to analyze the entire dataset. */ /* 2. List between () the families to be analyzed. */ /* Use the format: ('family number','family number') */ /* */ /* The user can specify the Homogenity of Variance Test to be used. */ /* The statement to invoke the macro may be: */ /* %dist(hovtest=bartlett); to invoke the Bartlett's test */ /* %dist(hovtest=levene); to invoke the Levene's test */ /* If the user does not specify any test, then Bartlett's */ /* test will be performed. */ /***********************************************************************/ * if Family in('17','18','19'); %dist (hovtest=bartlett); run;