asdocx: Export from Stata to Word, Excel, LaTeX & HTML Forums asdocx Forum ttest – number format with large numbers (exponential notation) Reply To: ttest – number format with large numbers (exponential notation)

Greg Hebb
Participant
Post count: 3

Thanks. So I have simplied my dataset to the following:

input float assets byte bankparent
.001	0
.001	0
.0011	0
.0011	0
.0011	1
.0011	1
.0011	1
.0607	1
.0605	1
end

If I use asdoc, I get no errors and the following output:

asdoc ttest assets , by(bankparent)  replace dec(4) ///
       stat(obs mean dif  p) title(T-Test of differences for all Funds) ///
      save(table1all.doc)

Two-sample t test with equal variances
------------------------------------------------------------------------------
   Group |     Obs        Mean    Std. Err.   Std. Dev.   [95% Conf. Interval]
---------+--------------------------------------------------------------------
       0 |       4      .00105    .0000289    .0000577    .0009581    .0011419
       1 |       5       .0249    .0145745    .0325896   -.0155653    .0653653
---------+--------------------------------------------------------------------
combined |       9       .0143    .0087499    .0262497   -.0058773    .0344773
---------+--------------------------------------------------------------------
    diff |             -.02385    .0165259               -.0629277    .0152277
------------------------------------------------------------------------------
    diff = mean(0) - mean(1)                                      t =  -1.4432
Ho: diff = 0                                     degrees of freedom =        7

    Ha: diff <; 0                 Ha: diff != 0                 Ha: diff > 0
 Pr(T > t) = 0.0961         Pr(|T| > |t|) = 0.1922          Pr(T > t) = 0.9039

                    T-Test of differences for all Funds

------------------------------------------------------------------------------------------
                       |      obs1       obs2      Mean1      Mean2        dif    p_value 
-----------------------+------------------------------------------------------------------
assets by bankparent   |                                                                  
                   0 1 |         4          5       .001       .025      -.024       .192 
------------------------------------------------------------------------------------------

(note: file table1all.doc not found)
Click to Open File: table1all.doc

If I use the same data and options but instead use asdocx, I get the following output:

asdocx ttest assets , by(bankparent) replace dec(4) stat(obs mean dif p) title(T-Test of differences for all Funds) save(table1all.doc)

– local AllowedStats “mean se df obs t p sd dif”
– if !`: list stats in local(AllowedStats)'{
= if !1{
display as error “Error in the statistics(`statistics’) option!”
display as text “only the following statistics are allowed”
display as result “`AllowedStats'”
exit
}
– else loc statsOptions “stat(`stats’)”
= else loc statsOptions “stat( obs mean dif p )”
– set trace off
option T-Test not allowed
r(198);

If I remove all options, I get:

asdocx ttest assets , by(bankparent)
– local AllowedStats “mean se df obs t p sd dif”
– if !`: list stats in local(AllowedStats)'{
= if !1{
display as error “Error in the statistics(`statistics’) option!”
display as text “only the following statistics are allowed”
display as result “`AllowedStats'”
exit
}
– else loc statsOptions “stat(`stats’)”
= else loc statsOptions “stat()”
– set trace off

Two-sample t test with equal variances
——————————————————————————
Group | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval]
———+——————————————————————–
0 | 4 .00105 .0000289 .0000577 .0009581 .0011419
1 | 5 .0249 .0145745 .0325896 -.0155653 .0653653
———+——————————————————————–
combined | 9 .0143 .0087499 .0262497 -.0058773 .0344773
———+——————————————————————–
diff | -.02385 .0165259 -.0629277 .0152277
——————————————————————————
diff = mean(0) – mean(1) t = -1.4432
Ho: diff = 0 degrees of freedom = 7

Ha: diff < 0 Ha: diff != 0 Ha: diff > 0
Pr(T < t) = 0.0961 Pr(|T| > |t|) = 0.1922 Pr(T > t) = 0.9039

Two-sample t test with equal variances

—————————————————————————————————————————
| obs1 obs2 Mean1 Mean2 dif St_Err t_value p_value p_value
———————–+—————————————————————————————————
assets by bankparent |
0 1 | 4 5 .001 .025 -.024 .0165 -1.45 .192 .
—————————————————————————————————————————
asdocxtable(): 3301 subscript invalid
<istmt>: – function returned error
r(3301);

.