Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Recreating SAS "sums of squares" in Stata using anova and regress

From   "Joseph Coveney" <>
To   <>
Subject   Re: st: Recreating SAS "sums of squares" in Stata using anova and regress
Date   Thu, 20 Feb 2014 01:07:39 +0900

". . .  -contrast- is computing a Wald t-statistic and squaring it to compute
its r(F) matrix element.  That might be the basis for the slightly different
test statistics vis-à-vis ANOVA's sums of squares-based F-statistic."

I wasn't trying to imply that squaring a t-statistic is what's leading to the
slight discrepancy, but rather that the discrepancy might be due to algorithmic
differences between the ANOVA (sums of squares) approach and the Wald approach,
algorithmic differences that expose sensitivity to numerical precision.  I'm not
familiar with what the commands are doing behind the scenes, but, say, where
-anova- would compute the sums of squares that directly take cell count into
account from the beginning, -contrast- after -regress- (or -anova-) would first
compute the regression coefficients on an as-balanced basis and then weight the
linear contrast elements by the cell-count weighting factors (proportions)
after-the-fact.  With any matrix inversion and whatnot, the latter could be more
sensitive to numerical precision limitations, or sensitive in different ways
from those of the simpler, conventional sums-of-squares ANOVA approach.

Joseph Coveney

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index