Bookmark and Share

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, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: RE: multi-dimensional chi-squared?

From   Steven Samuels <>
Subject   Re: st: RE: multi-dimensional chi-squared?
Date   Tue, 20 Jul 2010 22:13:53 -0400

Download -mgof-, Goodness-of-fit tests for multinomial data,  from SSC

There are assumptions behind -mgof-. One is that there is no dependence of the counts in different weeks (This is different from assuming that the decision to put an item on sale each week was independent of the decision for the other items that week.) . A second is that the probabilities were constant from week-to-week. Without more information on how the data were generated, it's difficult to say more.


On Jul 20, 2010, at 10:54 AM, Chevalier, Judy wrote:

Hello. I am fairly new to this listserve. I have a question about how one my think about constructing a test statistic and then how to program it in STATA. I may be missing a good way to think about it. I will present this in the context of an economics/marketing dataset, though it may have a close analog in other domains.

Consider a dataset with multiple products (let's call them 4 different brands of peanut butter to be concrete) observed over multiple weeks. I have coded whether each product for each week is at its regular price or on sale. I am interested in the question of whether one and only one product being on sale in a given week occurs more frequently than would be predicted if the product sales were independent of one another. So, I have (easily calculated) the frequency with which:

0 items are on sale
1 item is on sale
2 items are on sale
3 items are on sale
All 4 items are on sale.

Also, given the overall frequency that each item is on sale, I have also easily calculated the predicted probability (under the null hypothesis of independence) that 0 items would be on sale, 1 item would be on sale, 2 items would be on sale, 3 items would be on sale, etc.

I can see that 1 item is on sale more frequently in the data than would be predicted under the null hypothesis of independence, and, of course, the other categories are somewhat less frequent than would be predicted under the null. However, I am stymied as to how to construct an appropriate test statistic. I can test for the independence of the sales for each item, pairwise, easily, using Stata, but I can't quite manage the right test statistic nor how to compute it in Stata. I will actually repeat this test for some other samples--- the products will be different, the number of products will be different, but the hypothesis will be the same-- that 1 and only 1 product is on sale more often than would be predicted under the null of independence.

If you have gotten this far-thanks for reading!


*   For searches and help try:

*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index