Agriculture Reference
In-Depth Information
The chi 2 2 ) goodness-of-fit is calculated by the following formula:
(
)
2
k
OB
Ex
Ex
χ 2
=
i
=
1
This formula is the sum of the observed (Ob) minus the expected (Ex)
squared over the expected. This value, along with the degrees of free-
dom, is used to calculate a probability.
Open the do -ile Binomial distribution.do , which calculates
the probabilities for each possible ratio among the litters. Enter the
command
chisquare offspring
This information is then used with the csgof command to calcu-
late the chi 2 and the probability with the following output:
+----------------------------------------+
| offspr~g expperc expfreq obsfreq |
|----------------------------------------|
| 0 3.125 1.6875 3 |
| 1 15.625 8.4375 10 |
| 2 31.25 16.875 14 |
| 3 31.25 16.875 17 |
| 4 15.625 8.4375 9 |
|----------------------------------------|
| 5 3.125 1.6875 1 |
+----------------------------------------+
chisq(5) is 2.12, p = .8325
These results, with a p value of 0.8325, indicate that the makeup of
the litters does not deviate appreciably from the expected ratio of 50%
females and 50% males.
Finally, the Binomial distribution.do file is specifically written for
the Offspring.dta dataset. It could be modified, however, to have a
more general application. This may be a good exercise to improve your
programming skills.
The chi 2 goodness-of-fit calculation has other applications most
notably in genetics. Many characteristics are inherited by just one or
two genes. For example, in simple Mendelian inheritance, with a plant
species, where a gene has a single dominant allele and a homozygous
Search WWH ::




Custom Search