Announcement

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

  • One-sided t test regression

    Hello everyone,

    I don't have much experience with STATA and I'm working on my master's thesis. I would like to calculate one-sided t tests as "automatic" as possible. I found some instructions how to calculate it manually. Is it possible to get an output table like you get when using function regress, only with both, one and two sided t tests?

    Thank you for your answers in advance.

  • #2
    What do you mean by "manually"? Stata has the ttest command, which I think does what you want.
    You could automate a bit if you need to apply the test to many variables, for instance:

    Code:
    foreach v of varlist * {
        ttest `v'==0
    }
    If you require something more specific, you must tell us more about your setting. For instance, it's possible to write a program to (silently) apply the test to several variables, store results and print a single table of t- and p-values. Is that what you need?
    Last edited by Jean-Claude Arbaut; 28 Jun 2019, 04:31.

    Comment


    • #3
      Thank you so much for your response. Yes, I would need that what you wrote.

      Also, I will need to provide a regression output table (the one that appears when you simply do for example: reg y x1 x2...), only that some variables will have t- and p- values for one-sided test and others for two-sided test?

      (Right now I'm working on a list which variables would be tested one-sided and which two-sided, that is why I can't give you more specific info, when I'm done I can post it)

      Thank you.

      Comment


      • #4
        Ok, I'm not sure there is exactly this in base Stata or in SSC, so unless someone comes up with a solution, I'll have a look tonight.

        There are ttable and ttable2 on SSC, but apparently only for mean comparison between two groups.
        There is also this in the FAQ: The results from estimation commands display only two-sided tests for the coefficients. How can I perform a one-sided test?

        Just to be sure: you are comparing several variables (or coefficients in the case of regress) to the same constant, but with either two-sided or one of the two one-sided comparisons?

        Last edited by Jean-Claude Arbaut; 28 Jun 2019, 04:59.

        Comment


        • #5
          Ok thank you. No worries, I will try to do it following instructions from FAQ.

          Comment

          Working...
          X