Objective : We are comparing means using ANOVA, and our treatment levels are amounts of something. Thus regression hypotheses may shed light on how the treatments differ, for example is there an overall linear trend for the response variable to increase or decrease with treatment level. This is addressed by adding orthogonal polynomial contrasts to our ANOVA, which may require that we add contrast coefficients. Example : Treatments are amounts of corn in the diet, specifically 62%, 65%, 68%, 71% and 74%. SAS : IML product has an orthogonal polynomial calculator. Additional code here attempts to make the coefficients whole numbers by dividing by the smallest non-zero number. Note IML may not be available, depending on your license. proc iml; trtlevels={0.62, 0.65,0.68,0.71,0.74}; **this is only user input; ntrt=nrow(trtlevels); coeff=orpol(trtlevels); coeff = coeff[,2:ntrt]; div=abs(coeff); zerloc=loc(div<1e-14); if n...
Blogging on use of SAS and R software to perform statistical tasks for research data...