[R] different outcomes of P values in SPSS and R
Martin Teicher
martin_teicher at hms.harvard.edu
Sat Aug 14 05:26:56 CEST 2010
What your saying is true. The sequential/marginal difference can account for the discrepancy in p values but not necessarily the coefficients. One thing I've found that can lead to differences in coefficients and p values between R and SPSS is whether or not you specify that a variable is a factor (e.g., group2 <- factor(group) ).
Marty Teicher
On Aug 13, 2010, at 10:58 PM, Ben Bolker wrote:
> Yes, but ... the original poster said the coefficients differed too.
> (The blog post
> you refer to deals with ANOVA (i.e. linear models) rather than GLMs (generalized
> linear models): it is true that the sequential/marginal
> distinction still applies, but I don't think that can be the *only*
> thing going on here.)
>
>
> On Fri, Aug 13, 2010 at 10:50 PM, Martin Teicher
> <martin_teicher at hms.harvard.edu> wrote:
>> R usesType I sequential SS, not the default Type III marginal SS reported by SPSS. There is a good blog post explaining this difference along with some interesting comments -- http://myowelt.blogspot.com/2008/05/obtaining-same-anova-results-in-r-as-in.html
>>
>> Best Wishes,
>>
>> Martin H. Teicher
>> Dept of Psychiatry
>> McLean Hospital / Harvard Medical School
>> Belmont MA 02478
>>
>>
>> On Aug 13, 2010, at 10:32 PM, Ben Bolker wrote:
>>
>>> Leo Vorthoren <L.Vorthoren <at> nioo.knaw.nl> writes:
>>>
>>>> I have been using generalized linear models in SPSS 18, in order to build
>>>> models and to calculate the P values. When I was building models in Excel
>>>> (using the intercept and Bs from SPSS), I noticed that the graphs differed
>>>> from my expectations. When I ran the dataset again in R, I got totally
>>>> different outcomes for both the P values as well as the Bs and the
>>>> intercepts. The outcomes of R seem much more likely to be the correct ones,
>>>> but I really cannot explain the differences.
>>>
>>> I appreciate/assume that you're asking on the off chance that someone
>>> else has tried something very similar and gone to the trouble of figuring
>>> out the differences between R's and SPSS's default setup, but you're
>>> unlikely to get an answer without more detailed information.
>>>
>>> My best guess is that SPSS and R are using different contrasts
>>> and/or different baseline levels. R uses treatment contrasts by default,
>>> and assumes that the first (alphabetical) level of a factor is the
>>> baseline level.
>>>
>>> It's conceivable that you have a dataset where the results are
>>> numerically unstable and sensitive to small details in the algorithms
>>> used.
>>>
>>> ______________________________________________
>>> R-help at r-project.org mailing list
>>> https://stat.ethz.ch/mailman/listinfo/r-help
>>> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>>> and provide commented, minimal, self-contained, reproducible code.
>>
>>
More information about the R-help
mailing list