BookmarkSubscribeRSS Feed
mgalyean
Calcite | Level 5

The attached SAS code is for a manufactured dataset for a 4 x 4 Latin square design.  Treatments are unequally spaced (0, 120, 240, 480), and the 240 treatment has one missing value.  I used ORPOL in Proc IML to generate the coefficients for linear and quadratic contrasts to be used in Proc Mixed.  In the code, the coefficients are generated with and without weighting for the missing value.  When the coefficients from ORPOL are used in Proc Mixed, the linear and quadratic contrasts that are weighted for the missing observation are non-estimable, but the non-weighted coefficients work fine.  The weighted coefficients do not sum to zero, which I assume is why I'm getting the non-estimable error.  If I multiply the weighed coefficients by their respective weights, they sum to zero, and the contrasts are estimable.   I wondered whether anyone has encountered this issue, and whether multiplying the weighted ORPOL coefficients by the weights is the correct way to fix it.

 

 

3 REPLIES 3
SteveDenham
Jade | Level 19

This is just a gut feeling - the product of the coefficients and the weights makes sense to me, but I cannot regenerate your weights given only the sample size. Could you share how you get a weight vector of [1.9828 1.9574 1.6015 2.0167] from [4 4 3 4} for the linear contrast, and [1.9917 2.3803 1.7002 1.8362] for the quadratic?

 

SteveDenham

 

There should be an easier way than this.

 

SteveDenham

mgalyean
Calcite | Level 5

Thanks for the response, Steve.  It's good to hear from another animal scientist!  The contrast coefficients I have in the SAS file were calculated by multiplying the coefficients for unequal spacing and unequal sample size from ORPOL by the respective samples size for each treatment (4, 4, 3, 4 for the 0, 120, 240, and 480 treatments, respectively).  After some more digging, I've concluded that this approach isn't appropriate because it changes the relationships among the coefficients.  I came across a helpful paper (Gaito, 1965; Unequal intervals and unequal n in trend analyses; Psychological Bulletin 63(2):125-127) that detailed the hand calculations for linear and quadratic coefficients and for the contrast SS.  When I applied this approach to my data, the coefficients from the Gaito calculations were equivalent to those from ORPOL.  I subsequently found that I could use the Singular option with the contrasts in GLM or Mixed and allow them to be estimable.  This required the value in the Singular option to 0.1 for the linear contrast and 0.3 for the quadratic contrast.  The contrast SS and P-values from the GLM output were very close to those from the Gaito calculations, although not identical.  At this point, I've concluded that using the ORPOL coefficients for unequal spacing and unequal sample size per mean with the Singular option in Mixed or GLM is the best approach, but I suppose using the ORPOL coefficients and then calculating the contrast SS and conducting the F-test by hand is also an option.

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 576 views
  • 0 likes
  • 3 in conversation