Question: import scipy.stats as stats import numpy as np young = [ 2 9 , 3 7 , 3 3 , 2 7 , 2 8

import scipy.stats as stats
import numpy as np
young =[29,37,33,27,28,32,31,34,27,29]
old =[18,15,23,13,12,21]
# Independent samples
print("Independent")
# Less than test
print("Less-than")
# Point estimate
pt_est = np.mean(young)- np.mean(old)
print(round(pt_est, 4))
# Standard error
std_err = np.sqrt(np.var(young, ddof=1)/len(young)+ np.var(old, ddof=1)/len(old))
print(round(std_err, 4))
# Test statistic
test_stat =(np.mean(young)- np.mean(old))/ std_err
print(round(test_stat, 4))
# Degrees of freedom
df = len(young)+ len(old)-2
print(int(df))
# Critical value
crit_val = stats.t.ppf(0.90, df)
print(round(crit_val, 4))
# Conclusion
print("Yes")
# Margin of error
moe = std_err * crit_val
print(round(moe,4))
# Lower confidence bound
lcb = pt_est - moe
print(lcb)
# Confidence interval check
print("Yes")
# Possible error
print("Type II")

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 Databases Questions!