Announcement

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

  • T-test in mean across deciles and H-L difference

    Hello!! In the following table, I have generated 10 deciles sorted on MAX variable, for variable R:


    I would like to perform a t-test for each decile mean of R, testing the hypothesis of a 0 mean. I would like also to perform a t-test for the difference in mean between high and low decile as in the table below:

    How is it possible to achieve this?

    For the comparison between High and Low decile, I have used the command: ttest R if inlist(decMax, 1, 10), by(decMax)

    However I get the 1-10 difference, while I would like the 10-1.

    * I have raised the same question on Reddit:https://www.reddit.com/r/stata/comme...ow_difference/ but I didn't get an answer.

  • #2
    I have found that the command by decMax,sort: ttest R==0 possibly works for me(as I mistakenly thought that I had to use a two-sample test),but could anyone please help me with the High- low difference??

    Comment


    • #3
      The 10-1 difference is the same as the 1-10 difference, just with opposite sign. So just report the difference and t-statistic with their signs changed. The p-value is unchanged.

      Comment


      • #4
        Thank you very much Mr.Schechter!!!

        Comment

        Working...
        X