Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Internals A Deep Dive Into How Distributed Data Systems Work

Authors: Alex Petrov

1st Edition

1492040347, 978-1492040347

More Books

Students also viewed these Databases questions