Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Need help in below given details for hands on in Probability and Statistics. Code it Coding 1.Import chi2_contingency and chi2 from scipy.stats package. 2.Declare a
Need help in below given details for hands on in Probability and Statistics.
Code it
Coding
1.Importchi2_contingencyandchi2fromscipy.statspackage.
2.Declare a 2D array with the values mentioned in the contingency table of marital status by education.
3.Calculate and print the values of
- Chi-Square Statistic - Degree of Freedom - P value - Hint: Use chi2_contingency() function
4.Assume the alpha value to be 0.05
5.Compare the P value with alpha and decide whether or not to reject the null hypothesis.
- If Rejected print "Reject the Null Hypothesis" - Else print "Failed to reject the Null Hypothesis"
Execute the script with commandpython app.py | tee output.txt
Sample output 2.33 4.5 8.9 Reject the Null Hypothesis
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started