Everything I have read states that one of the conditions for inference of chi-squared is that random sampling is carried out (e.g. https://stattrek.com/chi-square-test/homogeneity.aspx). Can I still use chi-squared on subsets of an entire population (i.e. that together make up the population rather than samples of a population)?
I am doing an analysis project on titanic data (from Kaggle)
One thing I have discovered is that the mean survival rates for adult men, adult women, children and over 60s vary significantly. I want to prove that the differences are statistically significant.
(Note: When I state mean survival rate - The data is in the format where 0=Non-survivor and 1=Survivor. The mean is simply an average of the 1s and 0s for each demographic)
Update: following the responses, I tried using chi squared on my population and this is what I got.
| | Observed Survivors | Expected Survivors | Adult Man | 84 | 191.919192 | Adult Woman| 192 | 98.262626 | Child | 61 | 43.373737 | Senior | 5 | 8.444444
Using the data above and the chi-square script method I got a chi squared of 158. This seems very high. Have I done something wrong?
chisquare(f_obs = observed_survivors, f_exp = expected_survivors, ddof=3, axis =0)