Announcement

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

  • When is a 2 sample t-test equals the regression slope t-test?

    This is pretty basic:

    Say I want to produce a paired sample t-test of 2 variables V1 and V2. What would be the Stata regression command that will give me the same value of the t-test statistic for the slope being zero?

    MWE:

    Code:
    sysuse auto, clear
    ttest price == mpg
    In this example the t-test is 17.9, so I am looking for the regression command of these 2 variables which produces t-statistic for the slope that is equal to 17.9.

    (I thought it would be regress mpg price, noconstant but its not)

    Stata/MP 15.1

  • #2
    I'm not sure I completely understand, but a paired t-test is the same as estimating a regression where the output variable is equal to the difference of the two variables and there are no predictors, but a constant is included:
    Code:
    sysuse auto
    gen diff=price- mpg
    regress diff

    Comment


    • #3
      That's exactly what I meant. Thanks.
      Stata/MP 15.1

      Comment

      Working...
      X