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

Question 4 (3 points) Which of the following Python functions is used to perform

ID: 3368007 • Letter: Q

Question

Question 4 (3 points)

Which of the following Python functions is used to perform a hypothesis test for the difference in two population means when summary data from samples is provided for the two populations?

Question 4 options:

a)

import scipy.stats as st
st.ttest_ind(data1, data2, equal_var=False)

b)

from snhu_MAT243 import means_1samp_ttest
means_1samp_ttest(mean, std_dev, n, null_value, alternative)

c)

from scipy.stats import ttest_ind_from_stats as ttest
ttest(mean1, stdev1, n1, mean2, stdev2, n2, equal_var=False)

d)

from statsmodels.stats.proportion import proportions_ztest
proportions_ztest(counts, n)

Save

Question 5 (3 points)

Which of the following Python functions is used to perform a paired t-test?

Question 5 options:

a)

ttest(mean1, stdev1, n1, mean2, stdev2, n2, equal_var=False)

b)

ttest_rel(data1, data2)

c)

means_1samp_ttest(mean, std_dev, n, null_value, alternative)

d)

ttest_ind(data1, data2, equal_var=False)

Save

Question 6 (3 points)

Which of the following Python functions is used to perform a hypothesis test for the difference in two population proportions?

Question 6 options:

a)

prop_hypothesis_test(x, n, null_value, alternative)

b)

prop_1samp_ztest(x, n, null_value, alternative)

c)

proportions_ztest(counts, n)

d)

prop_1samp_hypothesistest(x, n, null_value, alternative)

Save

Question 7 (3 points)

How can we obtain a one-tailed probability value (P-Value) from Python functions that return a two-tailed probability value?

Question 7 options:

a)

Divide the result by 4

b)

Divide the result by 2

c)

Multiply the result by 2

d)

Multiply the result by 4

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)

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)

import scipy.stats as st
st.ttest_ind(data1, data2, equal_var=False)

b)

from snhu_MAT243 import means_1samp_ttest
means_1samp_ttest(mean, std_dev, n, null_value, alternative)

c)

from scipy.stats import ttest_ind_from_stats as ttest
ttest(mean1, stdev1, n1, mean2, stdev2, n2, equal_var=False)

d)

from statsmodels.stats.proportion import proportions_ztest
proportions_ztest(counts, n)

Explanation / Answer

4)
As the summary of two data sets are given/known we have to use
scipy.stats.ttest_ind_from_stats(mean1, stdev1, n1, mean2, stdev2, n2, equal_var=False)

mean1,mean2 are mean of sample 1 and sample 2.
stdev1,stdev2 are S.D. of sample 1 and sample 2.
n1,n2 are the number of observations of sample 1 and sample 2.
equal_var=False is an optional argument. False perform Welch’s t-test, which does not assume equal population variance.

Option 'C' is correct.

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