Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Disagreement between Welch's t-test values in SPSS and Stata

    Hi Everyone,

    I'm teaching a course for students where they will learn about statistical software using SPSS. However, I am generating a test bank of questions using Stata because it's much easier to work with. I am producing a large set of questions/answers with Stata and then students will reproduce those results in SPSS.

    I am currently writing questions for two-group mean comparisons and I have found a discrepancy between how Stata and SPSS produce estimates for robust t-tests. The data for these analyses are using the 2018 American General Social Survey from NORC.

    Code:
    ttest egomeans, by(abdefect) welch
    and

    Code:
    T-TEST GROUPS=abdefect(0 1)
      /MISSING=ANALYSIS
      /VARIABLES=egomeans
      /ES DISPLAY(TRUE)
      /CRITERIA=CI(.95).
    produce the same estimates with respect to Welch's t-value, but there is a discrepancy in the degrees of freedom (Stata = 258.699; SPSS = 257.655). I appreciate that the difference is small, but this discrepancy will interfere with what I'm trying to do. Can anyone clarify what is leading to this disagreement?

    Cheers,

    David.

  • #2
    What is the underlying formula used in SPSS? You can compare that to what Stata uses (see Methods and Formulas section).

    Comment


    • #3
      Hi Leonardo,

      I found an old .pdf that contrasted Stata and SPSS procedures and figured out what happened.

      Both t-test procedures are described as 'Welch', but the SPSS approach is actually using a Satterthwaite approximation for degrees of freedom, not a Welch approximation for degrees of freedom. You can produce equivalent results with:

      Code:
      ttest egomeans, by(abdefect) unequal
      Thanks for the suggestion!

      Cheers,

      David.

      Comment


      • #4
        I have some ancient notes on this that say both Stata and SPSS default to Satterthwaite's degrees of freedom, but if you add the welch option in Stata you get Welch's degrees of freedom. But either way the test statistic is the same, it is just the df that differ. Try dropping the welch option, or else adding it to SPSS if possible.

        For more (including formulas), see pp. 7-8 of

        https://www3.nd.edu/~rwilliam/stats1/x41.pdf

        You can also see pp. 3-4 of

        https://www3.nd.edu/~rwilliam/stats1...mple-Stata.pdf
        -------------------------------------------
        Richard Williams, Notre Dame Dept of Sociology
        StataNow Version: 19.5 MP (2 processor)

        EMAIL: [email protected]
        WWW: https://www3.nd.edu/~rwilliam

        Comment

        Working...
        X