Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.

# st: Chi-squared test for independence of observed and expected frequencies

 From "Marc Michelsen" To Subject st: Chi-squared test for independence of observed and expected frequencies Date Thu, 15 Jul 2010 17:33:23 +0200

```Dear all,

I am trying to copy the approach of Dittmar/Thakor (2007) "Why do firms
issue equity?" p. 27: The authors divide their sample of debt and equity
issuers into quartiles based on two explanatory variables, i.e. building a
matrix. Specifically, they examine the observed number of firms that fall
into one of the four categories and compare them to the expected
frequencies. After that, they apply a chi-squared test for independence to
determine if there are more or fewer firms than expected in each category.
Untabulated results show that each of these frequencies is significant.

I have managed to build the 4x3 matrix of observed and expected frequencies
using the user-written program ". tabchi [1. Dimension] [2. Dimension]". The
tabulated statistics include Pearson chi2(6) =  15.0080   Pr = 0.020 and
likelihood-ratio chi2(6) =  15.4736   Pr = 0.017. However, I struggle to
conduct this chi-squared test for independence to determine if there are
more or fewer firms than expected in each category.
I have tried user-written program ". chitesti" (part of the program
tab_chi), plugging into it the expected and observed frequencies. This gives
me Pearson chi2(11) =  15.0257   Pr =  0.181 and likelihood-ratio chi2(11) =
15.6908   Pr =  0.153. But this does not allow me to test the frequencies of
each (!) category.

What am I doing wrong? What is the correct and straightforward approach in
Stata for this type of problem?

Many thanks for considering this posting.

Regards
Marc

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/
```