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.

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.
Comment