Announcement

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

  • Multiple imputations and ttest

    I am working on multiply imputed dataset abut household wealth portfolios. I would like to check if the difference between participation rates of two groups in differenet assets types is significant. How could I apply the t test for equality of means to multiply impute data?

    I am using Stata 15.

  • #2
    A ttest is just a linear model regressing outcome on the group indicator variable, that is:

    Code:
    ttest depvar , by(groupvar)

    is the same as

    Code:
    regress depvar i.groupvar
    regress can be combined with mi.

    Best
    Daniel

    Comment


    • #3
      Thank you for your answer Daniel. Unfortunately I am not sure if I understand you correctly.

      I want to check if means of variable (for example Has Financial Assets) in two countries (groups) are equal. If I run your command I get output table with name of one country with insinificant coefficient and constant. Am I right that this means that difference between means of this variable in country A and B are not significant?

      Comment


      • #4
        Alexis:
        yes, you are.
        Look at the following toy-example; both -ttest- and -regress- provide the same result (ie, there's no evidence of a statistically significant difference for the price of foreign and domestic cars):
        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
        
        . regress price i.foreign
        
              Source |       SS           df       MS      Number of obs   =        74
        -------------+----------------------------------   F(1, 72)        =      0.17
               Model |  1507382.66         1  1507382.66   Prob > F        =    0.6802
            Residual |   633558013        72  8799416.85   R-squared       =    0.0024
        -------------+----------------------------------   Adj R-squared   =   -0.0115
               Total |   635065396        73  8699525.97   Root MSE        =    2966.4
        
        ------------------------------------------------------------------------------
               price |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
        -------------+----------------------------------------------------------------
             foreign |
            Foreign  |   312.2587   754.4488     0.41   0.680    -1191.708    1816.225
               _cons |   6072.423    411.363    14.76   0.000     5252.386     6892.46
        ------------------------------------------------------------------------------
        
        .
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          To add to Carlo's example: the results are exactly the same when you omit the unequal option from thettest command; the results are very similar when you keep the unequal option in the ttest command and add vce(robust) to the regress command.

          Best
          Daniel

          Comment

          Working...
          X