Agriculture Reference
In-Depth Information
4 | 33 44 19 | 96
| 32.1 41.7 22.1 | 96.0
-----------+---------------------------------+----------
5 | 7 9 6 | 22
| 7.4 9.6 5.1 | 22.0
-----------+---------------------------------+----------
Total | 77 100 53 | 230
| 77.0 100.0 53.0 | 230.0
Pearson chi2 (8) = 12.9152 Pr = 0.115
This table lists the five tractors in the first column and then lists
the frequency of repairs for each (e.g., tractor 1: 17 electrical, 19 fuel
supply, and 7 other). The second set of numbers (14.4, 18.7, 9.9) is the
expected frequencies for each category. The expected frequencies are
calculated by
Expected frequency= rowtotal
×
columntot
al
grandtotal
For example, (43)(77)/(230) = 14.4. The Pearson chi2 (8) is the
chi 2 calculation with 8 degrees of freedom (r-1)(c-1) = (5-1)(3-1). The
calculated value (12.9152) and the probability (Pr = 0.115) indicate
that the make of tractor and number of repairs are independent. To
put it another way, there isn't any difference in repair frequency due
to make of tractor.
Although this datum is entered individually for each tractor, it
might have been compiled with the repair frequency listed for each
tractor type. To see how this might have been entered, enter the fol-
lowing commands:
preserve
contract repair tractor, freq(number)
This contracts the dataset using both the repair and tractor variables
to compile a third variable, frequency, with the frequency of each trac-
tor/repair combination. The option freq(frequency) can be left off and
Stata will automatically create the new variable with _freq as the new
variable name. This shows you another method of entering such data
with frequencies rather than each tractor individually. Next, enter the
following commands:
Search WWH ::




Custom Search