<jupyter_start><jupyter_text>4.8 Twitter users and news<jupyter_code>import math
""" Confidence Interval of 95%  Function

pe = the population point estimate
std = standard deviation of the population
sample_size = size of the sample

"""
#Standard error method that comes into computation
def standard_error(std, sample_size):
    return (std/(math.sqrt(sample_size)))


def ci_99(pe, se):
    z = 2.576

    ci_minus = pe - (z * se)
    ci_plus = pe + (z * se)
    ci = (ci_minus,ci_plus)
    #returns a tuple
    return ci<jupyter_output><empty_output><jupyter_text>**Given Data :** point estimate = 52%Standard Error = 2.4% Creating a 99 % confidence interval for the proportion of US adults Twitter users who get some news on Twitter.<jupyter_code>ci_99(52,2.4)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.0992462311557789, 'fraction_numerical': 0.02763819095477387, 'mean_word_length': 4.573426573426573, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '491160', 'license': 'MIT', 'n_tokens_mistral': 278, 'n_tokens_neox': 258, 'n_words': 84, 'path': 'Chapter 4/Exercises/4.8_Twitter_News_1.ipynb', 'repo_name': 'chikoungoun/OpenIntro', 'size': '796'}