Question

Use the link in the Jupyter Notebook activity to access your Python script. Once you have made your calculations, complete this discussion. The script will output answers to the questions given below. You must attach your Python script output as an HTML file and respond to the questions below.

In this discussion, you will apply the statistical concepts and techniques covered in this week's reading about hypothesis testing for the difference between two population proportions. In the previous week’s discussion, you studied a manufacturing process at a factory that produces ball bearings for automotive manufacturers. The factory wanted to estimate the average diameter of a particular type of ball bearing to ensure that it was being manufactured to the factory’s specifications.

Recently, the factory began a new production line that is more efficient than the existing production line. However, the factory still needs ball bearings to meet the same specifications. To compare the accuracy of the new process against the existing process, the factory decides to take two random samples of ball bearings. The first sample is of 50 randomly selected ball bearings from the existing production line, and the second sample is of 50 randomly selected ball bearings produced from the new production line. For each sample, the diameters of the ball bearings were measured.

The two samples will be generated using Python’s numpy module. These data sets will be unique to you, and therefore your answers will be unique as well. Run Step 1 in the Python script to generate your unique sample data.

Suppose that the factory claims that the proportion of ball bearings with diameter values less than 2.20 cm in the existing manufacturing process is the same as the proportion in the new process. At alpha=0.05, is there enough evidence that the two proportions are the same? Perform a hypothesis test for the difference between two population proportions to test this claim.

  1. Define the null and alternative hypotheses in mathematical terms as well as in words.
  2. Identify the level of significance.
  3. Include the test statistic and the P-value. See Step 2 in the Python script. (Note that Python methods return two tailed P-values. You must report the correct P-value based on the alternative hypothesis.)
  4. Provide a conclusion and interpretation of the test: Should the null hypothesis be rejected? Why or why not

    Click the block of code below and hit the Run button above. In [1]: import pandas as pd import numpy as np # create 50 randomStep 2: Performing hypothesis test for the difference in population proportions The 7-test for proportions can be used to tes
0 0
Add a comment Improve this question Transcribed image text
Answer #1

As you have executed the code cell. It throws tou an error about diameters_sample1_df is not defined.

You may be able to see that

 ['diameters']<2.20

its showing in blue color thats because python is unable to identify that blue text. This is because you are reffering to that column in wrong way.

The code which you have written is

 count1 = len(diameters_sample1_df[diameters_sample1_df['diameters']<2.20])

This code looks perfectly fine.

And also you should not apply the len function here. Try doing like this:

 count1 = diameters_sample1_df['diameters']<2.20] count1 = len(count1)

These all are different ways you can rectify your error. But still you should give a try this code to run in sequence mean first initialization/declaration/creation and then use it.

Try using small abbrevation variable names.

And most important thing, execute a code in each different cell. It will help you debug you errors. So that will be easy to detect where your error lies.

I recommend you to execute codes in one cell each. Don't just write all your code in one single cell.

Add a comment
Know the answer?
Add Answer to:
Use the link in the Jupyter Notebook activity to access your Python script. Once you have...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT