Question: In your initial post, address the following items: convert the array into a dataframe with the column name diameters using pandas library diameters _ sample

In your initial post, address the following items: convert the array into a dataframe with the column name "diameters" using pandas library
diameters_sample2_df = pd.DataFrame(diameters_sample2, columns=['diameters'])
diameters_sample2_df = diameters_sample2_df.round(2)print("Diameters data frame of the first sample (showing only the first five observations)")
print(diameters_sample1_df.head())
print()
print("Diameters data frame of the second sample (showing only the first five observations)")
print(diameters_sample2_df.head())
Diameters data frame of the first sample (showing only the first five observations)02.88
12.62
23.57
31.81
42.70
Diameters data frame of the second sample (showing only the first five observations)02.47
13.01
20.40
32.33
43.76Step 2: Performing hypothesis test for the difference in population proportions
The z-test for proportions can be used to test for the difference in proportions. The proportions_ztest method in statsmodels.stats. proportion submodule runs
this test. The input to this method is a list of counts meeting a certain condition (given in the problem statement) and a list of sample sizes for the two samples.
Counts Python list that is assigned the number of observations in each sample with diameter values less than 2.20.
n, Python list that is assigned the total number of observations in each sample.
Click the block of code below and hit the Run button above. Click the block of code below and hit the Run button above.number of observations in the first sample with diameter values less than 2.20.
count1= len(diameters_sample1_df[diameters_sample1_df['diameters']2.20])count2= len(diameters_sample2_df[diameters_sample2_df['diameters']2.20])counts =[count1, count2]n1= len(diameters_sample1_df)n2= len(diameters_sample2_df)n =[n1, n2]test_statistic, p_value = proportions_ztest(counts, n)
print("test-statistic =", round(test_statistic,2))
print("two tailed p-value =", round(p_value,4))
test-statistic =-0.71
two tailed p-value =0.4759End of initial post
Attach the HTML output to your initial post in the Module Four discussion. The HTML output can be downloaded by clicking File, then Download as, then
HTML. Be sure to answer all questions about this activity in the Module Four discussion.
Define the null and alternative hypotheses in mathematical
terms as well as in words.
Identify the level of significance.
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.)
Provide a conclusion and interpretation of the test: Should the
null hypothesis be rejected? Why or why not?
In your initial post, address the following

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!