Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import math
- print("Calculating confidence of 95%")
- avg = float(input("Enter average of the data:"))
- n = int(input("Enter number of items:"))
- sd = float(input("Enter standard devation:"))
- z = 1.96
- conf_high = avg + z * (sd/math.sqrt(n))
- conf_low = avg - z * (sd/math.sqrt(n))
- print("Confidence high: {}".format(conf_high))
- print("Confidence low: {}".format(conf_low))
- print("With 95 percent confidence we have determined that the\nmean of the data is between\n{} and {}".format(conf_low, conf_high))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement