Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

Question

Python Functions for Statistical Applications

1A. Implementation with the standard def keyword

Suppose you have done a statistical comparison using the Z-scores approach. Write a function for calculating the lower bound of the 95% CI. A starter code for this function is already provided to you below.

def compute_lower_bound(n, mu, stdev, z=1.96):
"""
Computes lower bound of a confidence interval
Parameters:
n: Type int. number of data points
mu: Type float. sample mean
stdev: Type float. sample standard deviation
z: Type float. critical value. Default to 95%CI that corresponds to value of 1.96
"""
# YOUR CODE HERE
# Hint: A correct implementation can be as short as just 1 line long!

1B. Using the function of Part 1A

Run your function on the following scenario:

There are 500 data points.

The sample mean is 2525

The sample standard deviation is 7.57.5

The critical value at 95% confidence, ?0.95�0.95, is a constant: 1.96

# YOUR CODE HERE

1C. Application of Part 1A

Now, you are asked to do the same computation as above, except for 99% CI now.

Hints:

Make a change to the function call, not the function itself

Consider Googl'ing the "99% confidence interval"

# YOUR CODE HERE

Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
    SEE MORE QUESTIONS
    Recommended textbooks for you
    Text book image
    Database System Concepts
    Computer Science
    ISBN:9780078022159
    Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
    Publisher:McGraw-Hill Education
    Text book image
    Starting Out with Python (4th Edition)
    Computer Science
    ISBN:9780134444321
    Author:Tony Gaddis
    Publisher:PEARSON
    Text book image
    Digital Fundamentals (11th Edition)
    Computer Science
    ISBN:9780132737968
    Author:Thomas L. Floyd
    Publisher:PEARSON
    Text book image
    C How to Program (8th Edition)
    Computer Science
    ISBN:9780133976892
    Author:Paul J. Deitel, Harvey Deitel
    Publisher:PEARSON
    Text book image
    Database Systems: Design, Implementation, & Manag...
    Computer Science
    ISBN:9781337627900
    Author:Carlos Coronel, Steven Morris
    Publisher:Cengage Learning
    Text book image
    Programmable Logic Controllers
    Computer Science
    ISBN:9780073373843
    Author:Frank D. Petruzella
    Publisher:McGraw-Hill Education