예제 #1
0
import math
from ss.stats_utils import confidence_interval, one_sample_prop_proportion, describe_stats
from ss.stats_utils import confidence_interval_from_data

######################################
# Exercise 1
######################################
data = [25, 32, 30, 20, 15, 34, 36, 28, 22, 31, 27, 33, 26, 19, 21, 20, 26, 35, 17, 24]

confidence = .95
describe_stats(data)
interval = confidence_interval_from_data(data, confidence)
print("confidence interval is: [{:.2f} ; {:.2f}] with {:.2f}%".format(interval[0], interval[1],
                                                                      confidence * 100))
예제 #2
0
import math
from ss.stats_utils import confidence_interval, one_sample_prop_proportion, describe_stats
from ss.stats_utils import two_sample_population, two_sample_proportion, two_sample_population_from_data

brand_a = [
    61, 110, 249, 93, 19, 95, 20, 41, 91, 67, 37, 50, 114, 150, 98, 54, 107,
    60, 19, 32
]
brand_b = [3, 18, 35, 55, 60, 68, 75, 83, 99, 114, 115, 125, 133, 136, 247]

confidence = 0.95
describe_stats(brand_a)
describe_stats(brand_b)
interval = two_sample_population_from_data(brand_a, brand_b, confidence)

print("confidence interval is: [{:.2f} ; {:.2f}] with {:.2f}%".format(
    interval[0], interval[1], confidence * 100))
예제 #3
0
import math
from ss.stats_utils import confidence_interval, one_sample_prop_proportion, describe_stats
from ss.stats_utils import two_sample_population, two_sample_proportion, two_sample_population_from_data

data_1 = [14, 4, 10, 6, 3, 11, 12]
data_2 = [16, 17, 13, 12, 7, 16, 11, 8, 7]

confidence = 0.99
describe_stats(data_1)
describe_stats(data_2)
interval = two_sample_population_from_data(data_1, data_2, confidence)
print("confidence interval is: [{:.2f} ; {:.2f}] with {:.2f}%".format(
    interval[0], interval[1], confidence * 100))
예제 #4
0
import math
from ss.stats_utils import confidence_interval, one_sample_prop_proportion, describe_stats
from ss.stats_utils import two_sample_population, two_sample_proportion, two_sample_population_from_data

salary = [118, 115, 122, 99, 106, 125, 102, 100, 92, 103, 113, 129]
piece_work = [115, 126, 113, 110, 135, 102, 124, 137, 108, 128]

confidence = 0.99
describe_stats(salary)
describe_stats(piece_work)
interval = two_sample_population_from_data(salary, piece_work, confidence)

print("confidence interval is: [{:.2f} ; {:.2f}] with {:.2f}%".format(
    interval[0], interval[1], confidence * 100))