Dear Statalist,
Maybe it is a bit strange to reply on one's own posting, but I'd like to share what I found
in closing my gap between two-way anova and regression analysis.
Two texts were very helpfull to me:
Cohen et al. (2002) made clear to me that '[partial sum of squares is] used by current
ANOVA programs applied to unequal n desgins, and it depends critically on using
unweighted effect codes'.
Sribney (2009) showed me how the anova program deals with collinearity.
The Stata code to obtain the Partial SS of foreign in:
*---------------- begin example --------------------------
sysuse auto, clear
anova mpg foreign rep78 foreign#rep78
*------------------ end example -----------------------------
can be obtained by regression analysis: by
*---------------- begin example --------------------------
sysuse auto, clear
// using unweighted effect coding:
recode foreign (0=-1) (1=1) , gen(foreign_uec)
tab rep78, gen(drep)
foreach var of varlist drep1-drep4 {
generate `var'_uec = `var'
replace `var'_uec =-1 if rep78==5
generate i`var' = `var'_uec * foreign_uec
}
regress mpg drep1_uec drep2_uec drep3_uec drep4_uec idrep3 idrep4
regress mpg drep1_uec drep2_uec drep3_uec drep4_uec idrep3 idrep4 foreign_uec
*------------------ end example -----------------------------
The Partial SS equals the difference in residual SS of the two regression models.
Kind regards,
Adriaan Hoogendoorn
GGZ inGeest, Amsterdam
References
Cohen, Cohen, AIken and West (2002)
'Applied multiple regression/correlation analysis in the behavioural sciences' ,
Lawrence Erlbaum Associates Publishers, Mahwah, New Jersey
Sribney (2009) 'How does the anova command handle collinearity?',
http://www.stata.com/support/faqs/stat/anova.html
________________________________________
From: [email protected] [[email protected]] On Behalf Of Hoogendoorn, Adriaan [[email protected]]
Sent: Monday, January 04, 2010 11:22 AM
To: [email protected]
Subject: st: Two-way anova vs linear regression: how can I understand Partial SS
Dear Statalist,
My question is more about statistics than about Stata, but also so elementary
that I'd like to post this problem here.
In ANOVA I have difficulty in understanding the notion of Partial Sum of
Squares - being the default option in Stata's anova.
In understanding statistical methods, I use linear regression (OLS) as a
reference method, since regression allows me to draw pictures in my mind
and is a method that I feel comfortable with. ANOVA is not so intuitive
to me. But since the underlying methods of OLS and ANOVA are essentially
the same (both General Linear Models - GLMs), I regard the difference
between these methods as "different interfaces" to the same GLM.
My question is:
'How can I obtain the Partial Sum of Squares of each of
the variables in the case of a two way anova with interaction by us of
regression analysis?'
or - more applied - :
How do I get the Partial SS of foreign in:
*---------------- begin example --------------------------
sysuse auto, clear
anova mpg foreign rep78 foreign#rep78
*------------------ end example -----------------------------
using regression analysis?
Kind regards,
Adriaan Hoogendoorn
GGZ inGeest, Amsterdam.
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/