Statistics question: Adjusting staffing levels to match customer traffic

AI Thread Summary
The discussion revolves around a statistics homework question regarding staffing adjustments based on customer traffic ratios throughout the week. The original poster calculated the total customer visits and derived predicted customer numbers for each day using the given ratios, resulting in a chi-squared value of 10.56, which indicated that the model was not satisfactory. Feedback from other participants clarified the appropriateness of the chi-squared test used, noting that it applies to multinomial distributions rather than Poisson distributions. They emphasized that the test's validity hinges on the normality of deviations rather than strict adherence to Poisson assumptions. The conversation highlights the importance of understanding statistical models and their applications in real-world scenarios.
Physics Dad
Messages
54
Reaction score
1
Hi, I have a very basic statistics homework question, and I have given it a go, but I just wanted to know if I had approached it correctly:

QUESTION
A shop adjusts its staffing levels using a model of customer demand through the week in the ratio of: 0.22(Mon); 0.14(Tue); 0.16(Wed); 0.18(Thu); 0.30(Fri)

When opening a new branch of the shop customer levels were measured as: 2680(Mon); 1600(Tue); 2020(Wed); 2250(Thu); 3650(Fri)

By normalising the model, make a prediction for the number of customers on each day of the week.

Hence use chi-squared to determine if the model is satisfactory (Assume Poisson like errors).

ATTEMPT AT SOLUTION
First and foremost, I calculated the total number of people who visited the shop for the week = 12200.

For each day, I then calculated the predicted number of people based upon the ratio per day (total people * ratio) to give:

DAY Mon Tue Wed Thu Fri
OBSERVED 2680 1600 2020 2250 3650
PREDICTED 2684 1708 1952 2196 3660

To calculate the chi-squared value, I used χ2=∑[(observed-predicted)2/predicted] to give a chi-squared value of 10.56

Using reasonable logic and knowledge, I can say that the model is not satisfactory as this chi-squared value of 10.56 is well outside the prediction that chi-squared ≈ n.d.f. (where n.d.f. = 5-1 = 4).

NOTE

I feel I have been too simplistic in my approach.

I would appreciate any feedback.

Many thanks
 
Last edited:
Physics news on Phys.org
Physics Dad said:
Hi, I have a very basic statistics homework question, and I have given it a go, but I just wanted to know if I had approached it correctly:

QUESTION
A shop adjusts its staffing levels using a model of customer demand through the week in the ratio of: 0.22(Mon); 0.14(Tue); 0.16(Wed); 0.18(Thu); 0.30(Fri)

When opening a new branch of the shop customer levels were measured as: 2680(Mon); 1600(Tue); 2020(Wed); 2250(Thu); 3650(Fri)

By normalising the model, make a prediction for the number of customers on each day of the week.

Hence use chi-squared to determine if the model is satisfactory (Assume Poisson like errors).

ATTEMPT AT SOLUTION
First and foremost, I calculated the total number of people who visited the shop for the week = 12200.

For each day, I then calculated the predicted number of people based upon the ratio per day (total people * ratio) to give:

DAY Mon Tue Wed Thu Fri
OBSERVED 2680 1600 2020 2250 3650
PREDICTED 2684 1708 1952 2196 3660

To calculate the chi-squared value, I used χ2=∑[(observed-predicted)2/predicted] to give a chi-squared value of 10.56

Using reasonable logic and knowledge, I can say that the model is not satisfactory as this chi-squared value of 10.56 is well outside the prediction that chi-squared ≈ n.d.f. (where n.d.f. = 5-1 = 4).

NOTE

I feel I have been too simplistic in my approach.

I would appreciate any feedback.

Many thanks
You seem to have done exactly what the question asked for, though I am not sure what is meant by "assume Poisson-like errors".
 
Physics Dad said:
Hi, I have a very basic statistics homework question, and I have given it a go, but I just wanted to know if I had approached it correctly:

QUESTION
A shop adjusts its staffing levels using a model of customer demand through the week in the ratio of: 0.22(Mon); 0.14(Tue); 0.16(Wed); 0.18(Thu); 0.30(Fri)

When opening a new branch of the shop customer levels were measured as: 2680(Mon); 1600(Tue); 2020(Wed); 2250(Thu); 3650(Fri)

By normalising the model, make a prediction for the number of customers on each day of the week.

Hence use chi-squared to determine if the model is satisfactory (Assume Poisson like errors).

ATTEMPT AT SOLUTION
First and foremost, I calculated the total number of people who visited the shop for the week = 12200.

For each day, I then calculated the predicted number of people based upon the ratio per day (total people * ratio) to give:

DAY Mon Tue Wed Thu Fri
OBSERVED 2680 1600 2020 2250 3650
PREDICTED 2684 1708 1952 2196 3660

To calculate the chi-squared value, I used χ2=∑[(observed-predicted)2/predicted] to give a chi-squared value of 10.56

Using reasonable logic and knowledge, I can say that the model is not satisfactory as this chi-squared value of 10.56 is well outside the prediction that chi-squared ≈ n.d.f. (where n.d.f. = 5-1 = 4).

NOTE

I feel I have been too simplistic in my approach.

I would appreciate any feedback.

Many thanks

It is true that the null hypothesis is rejected at the 5% level, but would be accepted at any level ≤ 3.2 %.
 
tnich said:
You seem to have done exactly what the question asked for, though I am not sure what is meant by "assume Poisson-like errors".
$$\chi^2=\sum_i\frac{(Obs_i-Pred_i)^2}{\sigma_i^2}$$For Poisson statistics, ##\sigma_i=\sqrt{Obs_i}##, hence OP's equation (almost).
 
kuruman said:
$$\chi^2=\sum_i\frac{(Obs_i-Pred_i)^2}{\sigma_i^2}$$For Poisson statistics, ##\sigma_i=\sqrt{Obs_i}##, hence OP's equation (almost).
This is what I remembered, too, but I looked it up to be sure. What I found is that the form of the ##\chi^2## test you mention here appears to apply when sampling from a normal distribution, but it is not clear that it applies to a Poisson distribution. The form of the test the OP used applies to samples from a multinomial distribution, which seems appropriate. The Poisson distribution does have a variance equal to ##\sqrt {Pred_i} ## (as I read it), so I guess the hint given in the problem statement was to indicate the form of the ##\chi^2## to be used. See https://en.wikipedia.org/wiki/Chi-squared_test. Not having enormous faith in Wikipedia, I did check Hogg and Craig and found the same result.
 
tnich said:
This is what I remembered, too, but I looked it up to be sure. What I found is that the form of the ##\chi^2## test you mention here appears to apply when sampling from a normal distribution, but it is not clear that it applies to a Poisson distribution. The form of the test the OP used applies to samples from a multinomial distribution, which seems appropriate. The Poisson distribution does have a variance equal to ##\sqrt {Pred_i} ## (as I read it), so I guess the hint given in the problem statement was to indicate the form of the ##\chi^2## to be used. See https://en.wikipedia.org/wiki/Chi-squared_test. Not having enormous faith in Wikipedia, I did check Hogg and Craig and found the same result.

The ##\chi##-squared test is assessing the accuracy of a multinomial distribution; that is, it is testing the hypothesis that a sample occupancy vector ##(k_1, k_2, \ldots, k_r)## (with ##\sum k_i = n##) follows a mutinomial distribution
$$P(k_1, k_2, \ldots, k_r) = \binom{n}{k_1, k_2, \ldots, k_r} p_1^{k_1}\: p_2^{k_2} \cdots p_r^{k_r}, $$
for some vector of category probabilities ##(p_1, p_2, \ldots, p_r)## with ##\sum p_i = 1.##
For large ##n## (and all expected values ##n p_i## moderate-to-large) the vector of occupancies ##(X_1, X_2, \ldots, X_r)## is approximately a multivariate normal, so the deviations ##X_1 - n p_1, X_2 - n p_2, \ldots, X_r - n p_r## are mean-zero normal random variables (but correlated). If normality were exact the sum of the ##(X_i - n p_i)^2/ \sigma_i^2## would have a Chi-squared distribution with ##r-1## d.f. In practice, the Chi-squared is approximate because normality is approximate. I believe that the usual statements about near-validity of the Chi-squared in real cases is based on extensive analytical research and Monte-Carlo studies done by many people over many years.

Anyway, the test works if the deviations are normal, not Poisson!
 
Last edited:
I tried to combine those 2 formulas but it didn't work. I tried using another case where there are 2 red balls and 2 blue balls only so when combining the formula I got ##\frac{(4-1)!}{2!2!}=\frac{3}{2}## which does not make sense. Is there any formula to calculate cyclic permutation of identical objects or I have to do it by listing all the possibilities? Thanks
Since ##px^9+q## is the factor, then ##x^9=\frac{-q}{p}## will be one of the roots. Let ##f(x)=27x^{18}+bx^9+70##, then: $$27\left(\frac{-q}{p}\right)^2+b\left(\frac{-q}{p}\right)+70=0$$ $$b=27 \frac{q}{p}+70 \frac{p}{q}$$ $$b=\frac{27q^2+70p^2}{pq}$$ From this expression, it looks like there is no greatest value of ##b## because increasing the value of ##p## and ##q## will also increase the value of ##b##. How to find the greatest value of ##b##? Thanks
Back
Top