PLEASE HELP.... Which of the following Python functions is used to perform a hyp
ID: 3920899 • Letter: P
Question
PLEASE HELP....
Which of the following Python functions is used to perform a hypothesis test for the difference in two population means using data from a sample (i.e., using actual sample data and not using summary data)?
Question options:
a)
ttest_rel(data1, data2)
b)
ttest_ind(data1, data2, equal_var=False)
d)
means_1samp_ttest(mean, std_dev, n, null_value, alternative)
A professor is interested in finding out whether the average score in the second exam is the same as the average score in the first exam. Suppose two samples are collected for the two exams and saved in the ExamScores.csv file. The variables are called Exam1 and Exam2 respectively. Which of the following Python lines can be used to perform a hypothesis test to investigate if there is sufficient evidence to conclude that average score in the second exam is not equal to the first exam?
a)
import scipy.stats as st
import pandas as pd
scores = pd.read_csv('ExamScores.csv')
print(st.ttest_ind(scores))
b)
import scipy.stats as st
import pandas as pd
scores = pd.read_csv('ExamScores.csv')
exam1_scores = scores[['Exam1']]
exam2_scores = scores[['Exam2']]
print(st.ttest_ind(exam1_scores, exam2_scores, equal_var=False))
d)
import scipy.stats as st
scores = pd.read_csv('ExamScores.csv')
exam1_scores = scores[['Exam1']]
exam2_scores = scores[['Exam2']]
print(st.ttest_ind(exam1_scores, exam2_scores, equal_var=False))
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?
a)
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)
b)
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
c)
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
How can we obtain a one-tailed probability value (P-Value) from Python functions that return a two-tailed probability value?
a)
Divide the result by 4
b)
Divide the result by 2
c)
Multiply the result by 4
a)
ttest_rel(data1, data2)
b)
ttest_ind(data1, data2, equal_var=False)
d)
means_1samp_ttest(mean, std_dev, n, null_value, alternative)
A professor is interested in finding out whether the average score in the second exam is the same as the average score in the first exam. Suppose two samples are collected for the two exams and saved in the ExamScores.csv file. The variables are called Exam1 and Exam2 respectively. Which of the following Python lines can be used to perform a hypothesis test to investigate if there is sufficient evidence to conclude that average score in the second exam is not equal to the first exam?
Question options:a)
import scipy.stats as st
import pandas as pd
scores = pd.read_csv('ExamScores.csv')
print(st.ttest_ind(scores))
b)
import scipy.stats as st
import pandas as pd
scores = pd.read_csv('ExamScores.csv')
exam1_scores = scores[['Exam1']]
exam2_scores = scores[['Exam2']]
print(st.ttest_ind(exam1_scores, exam2_scores, equal_var=False))
d)
import scipy.stats as st
scores = pd.read_csv('ExamScores.csv')
exam1_scores = scores[['Exam1']]
exam2_scores = scores[['Exam2']]
print(st.ttest_ind(exam1_scores, exam2_scores, equal_var=False))
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 options:a)
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)
b)
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
c)
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
How can we obtain a one-tailed probability value (P-Value) from Python functions that return a two-tailed probability value?
Question options:a)
Divide the result by 4
b)
Divide the result by 2
c)
Multiply the result by 4
Explanation / Answer
SOLUTION:-
(1):- (B)
ttest_ind(data1, data2, equal_var=False)
============================================================================
(2):- Correct answer:-
import scipy.stats as st
import pandas as pd
scores = pd.read_csv('ExamScores.csv')
exam1_scores = scores[['Exam1']]
exam2_scores = scores[['Exam2']]
null_value = 0
alternative = 'not-equal'
print(st.ttest_ind(exam1_scores, exam2_scores, equal_var=False, null_value, alternative))
==========================================================================
(3):- (C)
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
============================================================================
(4):- (B) Divide the result by 2
===========================================================================
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.