Announcement

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

  • ttest returns an error of "option reverse not allowed"

    The code below returns what I need but I would like to reverse the coding of my group variable such that the ttest examines diff = mean(1.Yes)-mean(0.No) instead of diff = mean(0.No) - mean(1.Yes). Adding the reverse option should do the job but it returns an error of "option reverse not allowed":

    ttest CESD , by(mygroupvar)

  • #2
    Reproducible example, please.

    Comment


    • #3
      the -reverse- option was introduced in the 23aug2019 updated to Stata 16. Are you using at least this version of Stata?

      Please also note that ttest (and most other commands in Stata) expect numeric values for the analysis variables, and not string values. -ttest, by()- is no different. If you have the minimum version of Stata, and it still doesn't work, then place heed Daniel's advice and provide a data example (refer to FAQ, especially section 12.2).

      Code:
      help whatsnew16
      update 23aug2019:

      10. ttest with option by() now allows the order of the mean difference to be reversed using new option reverse. With reverse, the mean of the group with the smallest category is subtracted from the mean of the group with the largest category. The
      opposite is true by default.

      Comment

      Working...
      X