Announcement

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

  • one-tail test command

    Dear All

    I have a quick question here regarding one-tail test command in Stata.

    My alternate hypothesis predicts that DSTATE<0.

    The regression results show that DSTATE has a negative coefficient -0.245 with p-value 0.000 (this is the standard regression p-value i.e two-tailed).

    Could you please suggest a command which can test for one-tailed test as per my alternative hypothesis?

    Many thanks

    Yahya

  • #2
    Yahya:
    the following toy-example might be useful:
    Code:
    . sysuse auto.dta
    (1978 Automobile Data)
    
    . ttest price, by(foreign) unequal
    
    Two-sample t test with unequal variances
    ------------------------------------------------------------------------------
       Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
    ---------+--------------------------------------------------------------------
    Domestic |      52    6072.423    429.4911    3097.104    5210.184    6934.662
     Foreign |      22    6384.682    558.9942    2621.915     5222.19    7547.174
    ---------+--------------------------------------------------------------------
    combined |      74    6165.257    342.8719    2949.496    5481.914      6848.6
    ---------+--------------------------------------------------------------------
        diff |           -312.2587    704.9376               -1730.856    1106.339
    ------------------------------------------------------------------------------
        diff = mean(Domestic) - mean(Foreign)                         t =  -0.4430
    Ho: diff = 0                     Satterthwaite's degrees of freedom =  46.4471
    
        Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
     Pr(T < t) = 0.3299         Pr(|T| > |t|) = 0.6599          Pr(T > t) = 0.6701
    
    . di 1-ttail(46.4471,-0.4430)
    .32991111
    
    . di ttail(46.4471,-0.4430)
    .67008889
    
    .
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment

    Working...
    X