Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Question 9 (3 points) A group of 10,000 individuals were divided evenly into two

ID: 3368368 • Letter: Q

Question

Question 9 (3 points)

A group of 10,000 individuals were divided evenly into two groups. One group was given a vaccine and the other group was given a placebo. Of the 5,000 individuals in the first group, 95 individuals developed a disease. In the second group, 125 individuals developed the disease. Which of the following Python lines are used to perform the hypothesis test to investigate whether or not there is sufficient evidence to conclude that the proportion of individuals that were given the vaccine is less than the proportion who were given a placebo?

Question 9 options:

a)

from statsmodels.stats.proportion import proportions_ztest
n = [95, 125]
counts = [5000, 5000]
proportions_ztest(counts, n)
#Divide the output probability value by 2 to get 1 tailed probability value

b)

from statsmodels.stats.proportion import proportions_ztest
counts = [95, 125]
n = [5000, 5000]
proportions_ztest(counts, n)
#Divide the output probability value by 2 to get 1 tailed probability value

c)

from snhu_MAT243 import prop_1samp_ztest
n = 10000
x = 5000
null_value = 0.50
alternative = 'not-equal'
prop_1samp_ztest(x, n, null_value, alternative)

d)

from snhu_MAT243 import prop_1samp_ztest
n = 5000
x = 10000
null_value = 0.50
alternative = 'not-equal'
prop_1samp_ztest(x, n, null_value, alternative)

Save

Question 10 (3 points)

Sample data is collected in ExamScores.csv that includes scores in the first and second exams for students in a class. The variables are called Exam1 and Exam2 respectively. The professor is interested in finding out whether the average score in the second exam is different from the average score in the first exam, treating the data as matched-pair. Which of the following Python lines can be used to perform this test?

Question 10 options:

a)

import scipy.stats as st
import pandas as pd
scores = pd.read_csv('ExamScores.csv')
exam1_paired_score = scores[['Exam1']]
exam2_paired_score = scores[['Exam2']]
null_value = 0
alternative = 'not-equal'
print(st.ttest_rel(exam1_paired_score, exam2_paired_score, equal_var=False, null_value, alternative))

b)

import scipy.stats as st
import pandas as pd
scores = pd.read_csv('ExamScores.csv')
exam1_paired_score = scores[['Exam1']]
exam2_paired_score = scores[['Exam2']]
null_value = 0
alternative = 'not-equal'
print(st.ttest_ind(exam1_paired_score, exam2_paired_score, equal_var=False, null_value, alternative))

c)

import scipy.stats as st
import pandas as pd
scores = pd.read_csv('ExamScores.csv')
exam1_paired_score = scores[['Exam1']]
exam2_paired_score = scores[['Exam2']]
print(st.ttest_rel(exam1_paired_score, exam2_paired_score))

d)

from scipy.stats import ttest_ind_from_stats as ttest
import pandas as pd
scores = pd.read_csv('ExamScores.csv')
exam1_paired_score = scores[['Exam1']]
exam2_paired_score = scores[['Exam2']]
print(ttest(exam1_paired_score, exam2_paired_score))

a)

from statsmodels.stats.proportion import proportions_ztest
n = [95, 125]
counts = [5000, 5000]
proportions_ztest(counts, n)
#Divide the output probability value by 2 to get 1 tailed probability value

b)

from statsmodels.stats.proportion import proportions_ztest
counts = [95, 125]
n = [5000, 5000]
proportions_ztest(counts, n)
#Divide the output probability value by 2 to get 1 tailed probability value

c)

from snhu_MAT243 import prop_1samp_ztest
n = 10000
x = 5000
null_value = 0.50
alternative = 'not-equal'
prop_1samp_ztest(x, n, null_value, alternative)

d)

from snhu_MAT243 import prop_1samp_ztest
n = 5000
x = 10000
null_value = 0.50
alternative = 'not-equal'
prop_1samp_ztest(x, n, null_value, alternative)

Explanation / Answer

Question 9
As, we are comparing the proportions of two samples (One group was given a vaccine and the other group was given a placebo), option (c) and (d) are incorrect as they are using 1 sample z test.
In proportions_ztest(counts, n), counts represents the number of successes in n trials. Hence counts = [95, 125]
So, the correct option is b)

Question 10
As, the assumption is that the data as matched-pair, we need to use the scipy.stats.ttest_rel function for related (dependent) samples. So, option (b) and (d) are not correct.
equal_var is not a paramter of the ttest_rel function. It is a parameter of the function ttest_ind. So, option (a) is not correct.
So, the correct option is c)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote