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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Arrays
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
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education