<jupyter_start><jupyter_text>A7 - Regressions This notebook contains the linear regressions of all the variables of interest with both the death rates and the infection mortality rates. For all combinations, a regression line is plotted along with a 95% confidence interval area.<jupyter_code>import pandas as pd
import numpy as np
import seaborn as sns
all_metrics = pd.read_csv("all_metrics.csv")
health_infrastructure_indicators = [
    'Hospitals per 1,000 Population',
    'Community Health Centers per 1,000 Population',
    'Total beds per 1,000 Population',
    'ICU beds per 1,000 Population',
    'Total Primary Care Practitioners per 1,000 Population',
    'Percentage of Practitioners Needed Met']

for indicator in health_infrastructure_indicators:
    sns.lmplot(x=indicator, y='Deaths by 1,000 Population', data=all_metrics, fit_reg=True, ci=95, n_boot=1000)
    sns.lmplot(x=indicator, y='Deaths by 1,000 Cases', data=all_metrics, fit_reg=True, ci=95, n_boot=1000)<jupyter_output><empty_output><jupyter_text>Outliers The plots for 'Total Primary Care Practitioners per 1,000 Population' show some obvious outliers.<jupyter_code>all_metrics[['State', 'Total Primary Care Practitioners per 1,000 Population']].sort_values(by='Total Primary Care Practitioners per 1,000 Population', ascending=False).head(5)
filtered = all_metrics[all_metrics['State'] != 'District of Columbia']
filtered = filtered[filtered['State'] != 'Rhode Island']

sns.lmplot(x='Total Primary Care Practitioners per 1,000 Population', y='Deaths by 1,000 Population', data=filtered, fit_reg=True, ci=95, n_boot=1000)
sns.lmplot(x='Total Primary Care Practitioners per 1,000 Population', y='Deaths by 1,000 Cases', data=filtered, fit_reg=True, ci=95, n_boot=1000)<jupyter_output><empty_output><jupyter_text>Even removing the outliers, the relationship is still positive.<jupyter_code>all_metrics[['State', 'ICU beds per 1,000 Population']].sort_values(by='ICU beds per 1,000 Population', ascending=False).head(5)
filtered = all_metrics[all_metrics['State'] != 'District of Columbia']

sns.lmplot(x='ICU beds per 1,000 Population', y='Deaths by 1,000 Population', data=filtered, fit_reg=True, ci=95, n_boot=1000)
sns.lmplot(x='ICU beds per 1,000 Population', y='Deaths by 1,000 Cases', data=filtered, fit_reg=True, ci=95, n_boot=1000)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11125319693094629, 'fraction_numerical': 0.051577152600170505, 'mean_word_length': 7.235087719298246, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '211829', 'license': 'MIT', 'n_tokens_mistral': 872, 'n_tokens_neox': 724, 'n_words': 223, 'path': 'hcds-a7-regressions.ipynb', 'repo_name': 'benzatti/data-512-a7', 'size': '2346'}