Re: [R] R vs SPSS contrasts

2008-10-12 Thread Chuck Cleland
On 10/11/2008 3:31 PM, Ted Harding wrote: Hi Folks, I'm comparing some output from R with output from SPSS. The coefficients of the independent variables (which are all factors, each at 2 levels) are identical. However, R's Intercept (using default contr.treatment) differs from SPSS's

Re: [R] R vs SPSS contrasts

2008-10-12 Thread Gabor Grothendieck
Looks like the contrast matrix for indicator is contr.SAS(n), for deviation is contr.sum(n) and for simple is: (diag(n) - 1/n)[, -1] That works at least for the n = 3 example in the link. Perhaps the others could be checked against SPSS for a variety of values of n to be sure. On Sun, Oct 12,

Re: [R] R vs SPSS contrasts

2008-10-12 Thread Gabor Grothendieck
The formula should be (diag(n) - 1/n)[, -n] On Sun, Oct 12, 2008 at 1:36 PM, Gabor Grothendieck [EMAIL PROTECTED] wrote: Looks like the contrast matrix for indicator is contr.SAS(n), for deviation is contr.sum(n) and for simple is: (diag(n) - 1/n)[, -1] That works at least for the n = 3

Re: [R] R vs SPSS contrasts

2008-10-12 Thread Gabor Grothendieck
I found this link: http://webs.edinboro.edu/EDocs/SPSS/SPSS%20Regression%20Models%2013.0.pdf which indicates that the contrast in SPSS that is used depends not only on the contrast selected but also on the reference category selected and the two can be chosen independently. Thus one could have

Re: [R] R vs SPSS contrasts

2008-10-12 Thread Ted Harding
Very many thanks, Chuck and Gabor, for the comments and the references to on-line explanations. It is beginning to become clear! Most grateful. Ted. On 12-Oct-08 18:03:53, Gabor Grothendieck wrote: I found this link: http://webs.edinboro.edu/EDocs/SPSS/SPSS%20Regression%20Models%2013.0.pd f

Re: [R] R vs SPSS contrasts

2008-10-11 Thread Gabor Grothendieck
Don't know but perhaps you could just use each of: contr.helmert, contr.poly, contr.sum, contr.treatment, contr.SAS in turn on the R side until you get one that matches. Once you find out adding a contr.SPSS to R might be nice. On Sat, Oct 11, 2008 at 3:31 PM, Ted Harding [EMAIL PROTECTED]