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.
11.2. Continuous variables<br />
oneway<br />
compares means between two or more groups (analysis of variance):<br />
oneway price type [ , tabulate noanova]<br />
[R] oneway<br />
. oneway price type , tabulate<br />
type of | Summary of price per 75 cl bottle<br />
wine | Mean Std. Dev. Freq.<br />
------------+------------------------------------<br />
1. red | 48.15 12.650239 15<br />
2. white | 42.590909 20.016952 11<br />
3. rosé | 43.45 17.375268 6<br />
4. undeterm | 59.616666 15.821924 3<br />
------------+------------------------------------<br />
Total | 46.58 16.304104 35<br />
Analysis of Variance<br />
Source SS df MS F Prob > F<br />
------------------------------------------------------------------------<br />
Between groups 780.660217 3 260.220072 0.98 0.4162<br />
Within groups 8257.34954 31 266.366114<br />
------------------------------------------------------------------------<br />
Total 9038.00975 34 265.823816<br />
Bartlett's test for equal variances: chi2(3) = 2.3311 Prob>chi2 = 0.507<br />
The table, but not the test, could also be obtained by;<br />
tabulate type , summarize(price)<br />
anova<br />
Similar <strong>to</strong> oneway, but handles a lot of complex situations.<br />
[R] tabsum<br />
[R] anova<br />
table<br />
[R] table<br />
table is a flexible <strong>to</strong>ol for displaying several types of tables, but includes no statistical tests.<br />
To obtain the same table as in the oneway example:<br />
table type , content(n price mean price sd price)<br />
Here comes the mean price distribution by two variables. The format option gives a<br />
nicer display.<br />
. table type rating , content(mean price) format(%9.2f)<br />
----------------+------------------------------------------------------<br />
| quality rating<br />
type of wine | 1. poor 2. acceptable 3. good 4. excellent<br />
----------------+------------------------------------------------------<br />
1. red | 51.20 41.45 52.09 34.95<br />
2. white | 76.95 44.20 32.95 37.95<br />
3. rosé | 72.95 45.95 40.95<br />
4. undetermined | 55.95 45.95 76.95<br />
----------------+------------------------------------------------------<br />
30