With many thanks to Kit Baum, - ttestex - is now available via SCC, containing two commands ttestex and ttestex_time.
ttestex performs two sample t-tests on the equality of means using binary variables. This is useful to compare outcomes between e.g., males/females at one point in time.
It assumes variances to be equal. It exports the means and the p-value of the t-test to excel, as well as the labels of the dependent variables and the value labels of the binary variables.
Multiple dependent variables and binary variables can be specified, results are exported below and to the right of one another.
ttestex_time performs a paired t-test using variables. It assumes variances to be equal. This command is useful if you wish to compare outcomes for the same individuals/observations.
The t-tests can be performed among the total sample only but adding results for sub-samples is also possible by including binary/categorical variables (crosscuts) as an option.
It exports the means and the p-value of the t-test to excel, as well as the labels of the dependent variables and the value labels of the binary/categorical variables.
Multiple dependent variables and binary/categorical variables can be specified, results are exported below and to the right of one another.
To install BOTH of them, type:
The code makes use of Stata's ttest and putexcel, as well as Sergiy Radyakin's excelcol which you have to install before running ttestex/ttestex_time for the first time by typing:
ttestex performs two sample t-tests on the equality of means using binary variables. This is useful to compare outcomes between e.g., males/females at one point in time.
It assumes variances to be equal. It exports the means and the p-value of the t-test to excel, as well as the labels of the dependent variables and the value labels of the binary variables.
Multiple dependent variables and binary variables can be specified, results are exported below and to the right of one another.
ttestex_time performs a paired t-test using variables. It assumes variances to be equal. This command is useful if you wish to compare outcomes for the same individuals/observations.
The t-tests can be performed among the total sample only but adding results for sub-samples is also possible by including binary/categorical variables (crosscuts) as an option.
It exports the means and the p-value of the t-test to excel, as well as the labels of the dependent variables and the value labels of the binary/categorical variables.
Multiple dependent variables and binary/categorical variables can be specified, results are exported below and to the right of one another.
To install BOTH of them, type:
Code:
ssc install ttestex
Code:
ssc install excelcol