Announcement

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

  • univariate test

    Hello everyone,
    I have a question about how to apply uni-variate test in stata.
    My model as follows:
    HTML Code:
    reg log_patent log_CEOPAY firmsize leverage board_indp log_RD est_firm region_status num_of_ceo_major_expertise num_of_id_financial_expertise num_of_ceo_degree_expert num_of_ceo_job_experience n_of_fem_ceo av_ceo_shareholding av_ceo_age big4 soe btm1 tobinq1 roa log_develpo_expens
    which is
    how to compare between the means of two samples (in my model the variable
    HTML Code:
    soe
    )

    i thought i can use Ttest but this test use only for one variable.
    i want to get a table like the one in the attachment

    for more detail please see the picture attached
    thank you in advance
    Attached Files

  • #2
    Alkebsee:
    univariate in the (deprecated) screenshot you posted means that a -ttest- was conducted on each variable separately, setting aside the correlation between them (unlike what you get from -regress-)..
    That said, for each variable you can challege yourself with something along the following lines:
    Code:
    . set obs 100
    number of observations (_N) was 0, now 100
    
    . g CSR=runiform()*1000
    
    . g firm=0 in 1/50
    (50 missing values generated)
    
    . replace firm=1 if missing(firm)
    (50 real changes made)
    
    . label define firm 0 "private" 1 "public"
    
    . label val firm firm
    
    . ttest CSR, by(firm) unequal
    
    Two-sample t test with unequal variances
    ------------------------------------------------------------------------------
       Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
    ---------+--------------------------------------------------------------------
     private |      50     544.965    43.77794    309.5568    456.9899      632.94
      public |      50    449.7129    42.91137    303.4292    363.4792    535.9465
    ---------+--------------------------------------------------------------------
    combined |     100    497.3389      30.869      308.69    436.0881    558.5897
    ---------+--------------------------------------------------------------------
        diff |             95.2521    61.30166               -26.39966    216.9039
    ------------------------------------------------------------------------------
        diff = mean(private) - mean(public)                           t =   1.5538
    Ho: diff = 0                     Satterthwaite's degrees of freedom =  97.9609
    
        Ha: diff < 0                 Ha: diff != 0                 Ha: diff > 0
     Pr(T < t) = 0.9383         Pr(|T| > |t|) = 0.1235          Pr(T > t) = 0.0617
    
    .
    Eventually, you can think you can automatize the whole stuff via -foreach-.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      @Carlo Lazzaro thank you so much. I got it.

      Best Regards
      Alkebsee

      Comment

      Working...
      X