Statistics question: Adjusting staffing levels to match customer traffic

Click For Summary
SUMMARY

The discussion centers on a statistical analysis of customer traffic for a shop, where staffing levels are adjusted based on a model of customer demand. The observed customer counts for each day of the week were compared against predicted values derived from a ratio model. A chi-squared test was performed, yielding a value of 10.56, indicating that the model is not satisfactory as it exceeds the critical value for 4 degrees of freedom. The conversation also touches on the appropriateness of using chi-squared tests in the context of Poisson-like errors.

PREREQUISITES
  • Understanding of chi-squared tests and their applications
  • Familiarity with Poisson distribution and its properties
  • Basic knowledge of statistical modeling and hypothesis testing
  • Ability to perform calculations involving observed and predicted values
NEXT STEPS
  • Learn about the application of chi-squared tests in multinomial distributions
  • Study the implications of Poisson distribution in statistical analysis
  • Explore advanced statistical modeling techniques for demand forecasting
  • Investigate the use of statistical software for performing chi-squared tests
USEFUL FOR

Statisticians, data analysts, business analysts, and anyone involved in demand forecasting and staffing optimization in retail environments.

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: