[R] Type 3 sum of squares

Dennis Fisher fisher at plessthan.com
Mon Aug 16 20:17:41 CEST 2010


Colleagues,

R 2.11.1, OS X.  Please forgive my ignorance of some issues related to ANOVA.  I am trying to replicate some SAS analyses that use type 3 sum of squares.  The model that I am using is:
	lm(YVAR ~ DATA$SEQ + DATA$SEQ %in% DATA$ID + DATA$PERIOD + FRAME$FORMULATION)
The intent is to use SEQ, PERIOD, FORMULATION and (SEQUENCE nested in ID) as factors in the ANOVA.

I can replicate the sum of squares for model / error / total.  I have two questions:
	1.  SAS reports type 3 sum of squares for each of the factors.  How can I obtain these?

	2.  I am not sure that the coding of nesting in the formula is correct:
		DATA$SEQ %in% DATA$ID
	Any advice on this would be appreciated.

Dennis


Dennis Fisher MD
P < (The "P Less Than" Company)
Phone: 1-866-PLessThan (1-866-753-7784)
Fax: 1-866-PLessThan (1-866-753-7784)
www.PLessThan.com



More information about the R-help mailing list