asdocx: Export from Stata to Word, Excel, LaTeX & HTML › Forums › asdocx Forum › Ttest results, rounding and missing values › Reply To: Ttest results, rounding and missing values
Ozer Erdem
I have updated asdocx. It now fixes the decimal points problem in the ttest
results. You should now be able to see accurate decimal points in your results.
Additionally, for very small values, using the c#_disfmt(%9.4e)
format is a better way to report values in exponential format. For example, instead of seeing 0.00000009
, you would see 9.00e-08
. This helps in making the results easier to read and understand.
asdocx_update
Here is an example:
* Create a dummy dataset clear input float group double score 1 .0000012 1 .000015 1 .0000214 2 .011 2 .039 2 .0610 end * Report 7 decimal places for the column 4 asdocx ttest score, replace c4_dec(7) by(group) stat(obs mean t) Table: Results 0 |1 2 3 4 5 6 ----+------------------------------------------------------------------------------------------ 1 | obs1 obs2 Mean1 Mean2 t_value ----+------------------------------------------------------------------------------------------ 2 |score by group: 1 2 3 3 0.0000125 0.037 -2.556 ----------------------------------------------------------------------------------------------- * Report exponential format for column 4 asdocx resetfmt asdocx ttest score, replace tzok c4_disfmt(%9.4e) by(group ) stat(obs mean t) Two-sample t test with equal variances ------------------------------------------------------------------------------ Group | Obs Mean Std. Err. Std. Dev. [95% Conf. Interval] ---------+-------------------------------------------------------------------- 1 | 3 .0000125 5.96e-06 .0000103 -.0000131 .0000382 2 | 3 .037 .0144684 .0250599 -.0252523 .0992523 ---------+-------------------------------------------------------------------- combined | 6 .0185063 .010501 .025722 -.0084873 .0454999 ---------+-------------------------------------------------------------------- diff | -.0369875 .0144684 -.0771581 .0031831 ------------------------------------------------------------------------------ diff = mean(1) - mean(2) t = -2.5564 Ho: diff = 0 degrees of freedom = 4 Ha: diff < 0 Ha: diff != 0 Ha: diff > 0 Pr(T < t) = 0.0314 Pr(|T| > |t|) = 0.0629 Pr(T > t) = 0.9686 Table: Results 0 |1 2 3 4 5 6 ----+---------------------------------------------------------------------------------------- 1 | obs1 obs2 Mean1 Mean2 t_value ----+---------------------------------------------------------------------------------------- 2 |score by group: 1 2 3.000 3.000 1.25e-05 0.037 -2.556 --------------------------------------------------------------------------------------------- Notes: