<jupyter_start><jupyter_text>q23 of chap2 and q3 of adhd study<jupyter_code>adhd.plot()<jupyter_output><empty_output><jupyter_text>chap2 "Graphing Distributions" q25<jupyter_code>adhd.boxplot()<jupyter_output><empty_output><jupyter_text>chap3 : "Summarizing Distributions q30 What is the mean number of correct responses of the participants after taking the placebo (0 mg/kg)<jupyter_code>adhd['D0'].mean()
adhd['D0'].std()
adhd['D0'].quantile(.75)-adhd['D0'].quantile(.25)<jupyter_output><empty_output><jupyter_text>chap4 "Describing Bivariate Data" q24 What is the correlation between the participants' correct number of responses after taking the placebo and their correct number of responses after taking 0.60 mg/kg of MPH?<jupyter_code>from scipy.stats.stats import pearsonr
pearsonr(adhd["D0"], adhd["D60"])<jupyter_output><empty_output><jupyter_text>Chapter 10: "Estimation" Q32 What is the correlation between the participants' correct number of responses after taking the placebo and their correct number of responses after taking 0.60 mg/kg of MPH? Compute the 95% confidence interval on the population correlation.<jupyter_code>def z_trans(r):
    return(.5*np.log((1 + r) / (1 - r)))
def r_trans(z):
    return((np.exp(2*z)-1)/(np.exp(2*z)+1))
len(adhd)
n=24
r=adhd["D0"].corr(adhd["D60"])
z = z_trans(r)
std_err_z = 1/(n-3)**.5
lower = z - 1.96 * std_err_z
upper= z + 1.96 * std_err_z
print(r_trans(lower))
print(r_trans(upper))<jupyter_output>0.58521287404
0.909697656671
{'fraction_non_alphanumeric': 0.12996632996632998, 'fraction_numerical': 0.05589225589225589, 'mean_word_length': 6.946524064171123, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 20, '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': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '365349', 'license': 'MIT', 'n_tokens_mistral': 593, 'n_tokens_neox': 538, 'n_words': 134, 'path': 'case_studies/adhd_study.ipynb', 'repo_name': 'aicharles/online_stats_book_python', 'size': '1485'}