Memuat
Memuat
Chi-Square Test for Tourism and Hospitality
0 views
Test the association between restaurant type and categories of spending per tourist in culinary tourism restaurants with a Chi-Square test on a contingency table. The Chi-Square test examines the association between two categorical variables in a contingency table, or the fit of a distribution to expected proportions. It suits categorical survey data such as gender and response choice.

Test the association between restaurant type and categories of spending per tourist in culinary tourism restaurants with a Chi-Square test on a contingency table.
| Role | Variable | Unit |
|---|---|---|
| Main | spending per tourist | Rp ribu |
| Supporting 1 | restaurant type | - |
| Supporting 2 | seating capacity | kursi |
The chi-square test between restaurant type and spending per tourist levels shows an association (chi2 = 29.714, df = 4, p < 0.001) with a Cramer's V of 0.198.
Computed from illustrative synthetic data, not from a real study.
The Chi-Square test examines the association between two categorical variables in a contingency table, or the fit of a distribution to expected proportions. It suits categorical survey data such as gender and response choice.
Report chi-square, degrees of freedom, sample size, p-value, and Cramer's V, plus the cells with the largest standardised residuals. Stress that association does not imply causation.
A short starting script with this project's variable names. The delivered version is adapted to your data and fully commented.
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import scipy.stats as st
rng = np.random.default_rng(27)
n = 300
restaurant_type = rng.choice(["Male", "Female"], n)
p_yes = np.where(restaurant_type == "Female", 0.65, 0.45)
spending_per_tourist = np.where(rng.random(n) < p_yes, "Agree", "Disagree")
tab = pd.crosstab(restaurant_type, spending_per_tourist)
chi2, p, dof, exp = st.chi2_contingency(tab)
print(tab)
print("chi2 =", round(chi2, 3), "dof =", dof, "p =", round(p, 4))
print("Min expected frequency:", round(exp.min(), 2))
v = np.sqrt(chi2 / (tab.values.sum() * (min(tab.shape) - 1)))
print("Cramer V:", round(v, 3))
resid = (tab.values - exp) / np.sqrt(exp)
print("Standardised residuals:\n", resid.round(2))
tab.plot(kind="bar", stacked=True)
plt.ylabel("Count")
plt.show()Choose how much help you need. Each higher package includes everything in the lower ones. Prices exclude 11% VAT.
Package 1
US$25
excl. 11% VAT
Duration: 5 working days
Output: Python files + result figures
Deliverables
Package 2 · most chosen
US$66
excl. 11% VAT
Duration: 9 working days
Output: Code + analysis + interpretation notes
Includes all of Package 1, plus
Package 3
US$147
excl. 11% VAT
Duration: 14-17 working days
Output: Code + analysis + guidance until ready to present
Includes all of Packages 1 & 2, plus
Yes. Chi-Square Test is commonly used at this level in Tourism and Hospitality. We adapt the analysis to your research question, your own data and your supervisor's requirements.
No. The sheet is computed from illustrative synthetic data so you can see the kind of output Python gives. For your order we run the same method on your own data.
That is the point of the packages. Every script is commented, and Package 3 includes two coaching sessions plus practice questions so you can explain the method and the results at your seminar and defence.
Each project has three packages: Package 1 (code and explanation) US$25, Package 2 (your data analysis and interpretation) US$66 and Package 3 (full guidance) US$147, excluding 11% VAT. Larger datasets, extra methods or tight deadlines adjust the quote after a short consultation.
The result sheet uses illustrative synthetic data. Python is a trademark of the Python Software Foundation.
Back to Python portfolio