SOLUTION: 1. Three supermarket chains in Quezon City each claim to have the lowest overall prices. As part of an investigative study on supermarket advertising, a particular news company se

Algebra ->  Probability-and-statistics -> SOLUTION: 1. Three supermarket chains in Quezon City each claim to have the lowest overall prices. As part of an investigative study on supermarket advertising, a particular news company se      Log On


   



Question 1163084: 1. Three supermarket chains in Quezon City each claim to have the lowest overall prices. As part of an investigative study on supermarket advertising, a particular news company selected nine available grocery items on a particular day. Then, the price of each selected item was checked at each of the three chains as shown in the table. Use  = 0.05 to compare the prices.
Item Supermarket 1 Supermarket 2 Supermarket 3
1 55.00 50.10 52.57
2 56.00 54.05 59.45
3 84.50 93.85 102.20
4 109.80 102.65 114.00
5 117.90 103.15 113.00
6 198.50 212.25 203.90
7 248.10 243.20 248.10
8 229.95 202.95 229.45
9 271.20 268.25 287.90

Answer by CPhill(2264) About Me  (Show Source):
You can put this solution on YOUR website!
```python?code_reference&code_event_index=1
import pandas as pd
import scipy.stats as stats
data = {
'S1': [55.00, 56.00, 84.50, 109.80, 117.90, 198.50, 248.10, 229.95, 271.20],
'S2': [50.10, 54.05, 93.85, 102.65, 103.15, 212.25, 243.20, 202.95, 268.25],
'S3': [52.57, 59.45, 102.20, 114.00, 113.00, 203.90, 248.10, 229.45, 287.90]
}
df = pd.DataFrame(data)
# Randomized Complete Block Design (RCBD)
# We treat "Items" as blocks because the price variance between a bag of rice and a candy bar
# is huge, but the variance across supermarkets for the SAME item is what matters.
# Calculate means
means = df.mean()
# Perform Two-Way ANOVA without replication (since each item is a block)
f_stat, p_val = stats.f_oneway(df['S1'], df['S2'], df['S3'])
# However, standard f_oneway is for Independent groups.
# For RCBD we need to extract the block effect.
# SS_total = SS_between_supermarkets + SS_between_items + SS_error
# Total Mean
grand_mean = df.values.mean()
# SS Total
ss_total = ((df.values - grand_mean)**2).sum()
# SS Blocks (Items)
ss_blocks = 3 * ((df.mean(axis=1) - grand_mean)**2).sum()
# SS Treatments (Supermarkets)
ss_treatments = 9 * ((df.mean(axis=0) - grand_mean)**2).sum()
# SS Error
ss_error = ss_total - ss_blocks - ss_treatments
# Degrees of Freedom
df_blocks = 8
df_treatments = 2
df_error = df_blocks * df_treatments
# Mean Squares
ms_treatments = ss_treatments / df_treatments
ms_error = ss_error / df_error
# F-statistic for Supermarkets
f_calc = ms_treatments / ms_error
p_value_final = 1 - stats.f.cdf(f_calc, df_treatments, df_error)
print(f"{means=}")
print(f"{ss_total=}")
print(f"{ss_blocks=}")
print(f"{ss_treatments=}")
print(f"{ss_error=}")
print(f"{f_calc=}")
print(f"{p_value_final=}")
```
```text?code_stdout&code_event_index=1
means=S1 152.327778
S2 147.827778
S3 156.730000
dtype: float64
ss_total=174336.29727407405
ss_blocks=173160.07200740743
ss_treatments=356.63736296296634
ss_error=819.5879037036509
f_calc=3.4811383755309335
p_value_final=0.05556998578932093
```
To compare the prices across the three supermarket chains, we use a **Randomized Complete Block Design (RCBD)**. In this study, the **Items** act as "Blocks" because the price difference between items (e.g., item 1 vs item 9) is much larger than the price difference between supermarkets.
### 1. Hypotheses
* **$H_0$ (Null Hypothesis):** There is no significant difference in the mean prices across the three supermarkets ($\mu_1 = \mu_2 = \mu_3$).
* **$H_A$ (Alternative Hypothesis):** At least one supermarket has a significantly different mean price.
### 2. Summary Statistics
* **Supermarket 1 Mean:** 152.33
* **Supermarket 2 Mean:** 147.83
* **Supermarket 3 Mean:** 156.73
### 3. ANOVA Table (RCBD)
Using the data provided, we calculate the Sum of Squares ($SS$), Degrees of Freedom ($df$), and Mean Squares ($MS$).
| Source of Variation | Sum of Squares ($SS$) | $df$ | Mean Square ($MS$) | $F$-calc |
| :--- | :--- | :--- | :--- | :--- |
| **Supermarkets (Treatments)** | 356.64 | 2 | 178.32 | **3.48** |
| **Items (Blocks)** | 173,160.07 | 8 | 21,645.01 | - |
| **Error** | 819.59 | 16 | 51.22 | - |
| **Total** | 174,336.30 | 26 | - | - |
### 4. Decision Rule
* **Significance Level ($\alpha$):** 0.05
* **Degrees of Freedom:** $df_1 = 2$, $df_2 = 16$
* **Critical Value ($F_{crit}$):** Using an F-table for $F(2, 16)$ at $\alpha = 0.05$, the critical value is **3.63**.
* **p-value:** 0.0556
### 5. Conclusion
Since the calculated $F$-value (**3.48**) is **less than** the critical value (**3.63**), and the $p$-value (**0.0556**) is **greater than** $\alpha = 0.05$, we **fail to reject the null hypothesis**.
**Final Interpretation:** At the 5% level of significance, there is **not enough evidence** to conclude that there is a significant difference in the overall prices among the three supermarket chains in Quezon City. While Supermarket 2 has a lower numerical average in this sample, the variation is not statistically significant.
Does this result surprise you, or does it align with what you'd expect from "lowest price" advertising wars?