Introduction to Stata 8 - (GRIPS
Introduction to Stata 8 - (GRIPS
Introduction to Stata 8 - (GRIPS
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
ttest<br />
[R] ttest<br />
T-test for comparison of means for continuous normally distributed variables:<br />
ttest bmi , by(sex)<br />
Standard t-test, equal variances assumed<br />
ttest bmi , by(sex) unequal<br />
Unequal variances (see sdtest)<br />
ttest prebmi==postbmi<br />
Paired comparison of two variables<br />
ttest prebmi==postbmi , unpaired Unpaired comparison of two variables<br />
ttest bmidiff==0<br />
One-sample t-test<br />
ttesti 32 1.35 .27 50 1.77 .33 Immediate command. Input n, mean<br />
n1 m1 sd1 n2 m2 sd2 and SD for each group<br />
Distribution diagnostics<br />
Diagnostic plots:<br />
pnorm bmi<br />
qnorm bmi<br />
[R] diagplots<br />
Normal distribution (P-P plot)<br />
Normal distribution (Q-Q plot)<br />
Formal test for normal distribution:<br />
swilk bmi<br />
Test for normal distribution<br />
[R] swilk<br />
Test for equal variances:<br />
sdtest bmi , by(sex)<br />
sdtest prebmi==postbmi<br />
[R] sdtest<br />
Compare SD between two groups<br />
Compare two variables<br />
Bartlett's test for equal variances is displayed by oneway, see above.<br />
Non-parametric tests<br />
For an overview of tests avilable, in the Viewer window command line enter:<br />
search nonparametric<br />
Here you see e.g.<br />
kwallis Kruskall-Wallis equality of populations rank test<br />
signrank Sign, rank, and median tests (Wilcoxon, Mann-Whitney)<br />
31