{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "worldwide-blood",
   "metadata": {},
   "source": [
    "# Introduction"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "understanding-numbers",
   "metadata": {},
   "source": [
    "Argument Project Research - Nelson Mason"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "greater-circular",
   "metadata": {},
   "source": [
    "## Overarching Question: \n",
    "I want to know about what relationship exists, if any, between an adult (18 +) person's age and their weight (metric-kg.).\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "permanent-pollution",
   "metadata": {},
   "source": [
    "# Data"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "technical-evans",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "import seaborn as sns\n",
    "sns.set_theme()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "overhead-sigma",
   "metadata": {},
   "outputs": [],
   "source": [
    "file_name = \"brfss_2020_cleaned.csv\"\n",
    "dataset_path = \"data/brfss_2020_cleaned.csv\"\n",
    "people = pd.read_csv(\"data/brfss_2020_cleaned.csv\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "fdd2f3af-ab54-442c-96de-14bc27a215b9",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Axes: xlabel='age', ylabel='count'>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 26680 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "sns.countplot(data=people, x=\"age\", hue=\"age\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "92404f8d-3c67-4d7b-8781-2f8725609eed",
   "metadata": {},
   "source": [
    "I want to see a count of people by every age group.\n",
    "Is this distribution of any significance?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "13abb8a8-b75d-4381-a0cd-92eabb0f2ca7",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Axes: xlabel='weight', ylabel='Count'>"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 20660 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "sns.histplot(data=people, x=\"weight\", bins=15)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "363219c6-9a49-4170-bc80-ae5a2b89606e",
   "metadata": {},
   "source": [
    "I want to see a count of people by weight(kg). Is this distribution of any significance?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "heated-blade",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Axes: xlabel='age', ylabel='weight'>"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 22480 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "sns.barplot(data=people, x=\"age\", y=\"weight\", hue=\"age\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "continental-franklin",
   "metadata": {},
   "source": [
    "I'm trying to find out at what age, on average, do people experience a dramatic\n",
    "weight gain or loss, if at all.\n",
    "I'm curious to find out if such a dramatic increase or decrease in weight can\n",
    "be captured in a one-time snapshot database, where individuals are NOT tracked \n",
    "over a period of time, but ONLY once."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6ac075dc-abfd-49eb-a2b9-b13220c4e850",
   "metadata": {},
   "source": [
    "Results"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7bac8b8f-10b6-49d2-8870-038e6e65ae0e",
   "metadata": {
    "jp-MarkdownHeadingCollapsed": true
   },
   "source": [
    "Since this chart of this dataset shows that an age 65+ person, on average, is closer in weight to an age 18 to 30 person, is that of any significance?"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "pursuant-surrey",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Axes: xlabel='age', ylabel='weight'>"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 35424 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "sns.boxplot(data=people, x=\"age\", y=\"weight\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "aadbdda2-c6a0-4321-b928-ebbe9b79f087",
   "metadata": {},
   "source": [
    "I want to see a distribution of people by age by weight."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "id": "located-night",
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Axes: xlabel='age', ylabel='weight'>"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "[encoded data, 47276 characters]",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "sns.violinplot(data=people, x=\"age\", y=\"weight\")"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "922844f3-5f2c-4efd-96d2-23dcc959d70c",
   "metadata": {},
   "source": [
    "I want to see the main distribution of people by age by weight."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "infectious-symbol",
   "metadata": {},
   "source": [
    "# Discussion"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "furnished-camping",
   "metadata": {
    "code_folding": []
   },
   "source": [
    "## Considerations"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a6127b6f-d244-48e2-8993-fcb4143ae7df",
   "metadata": {},
   "source": [
    "- Do the results give an accurate depiction of your research question? Yes. Why or why not? The dataset is a valid cross-section of U.S. people. There are 166,426 records in this database. \"This dataset includes data from 50 states, the District of Columbia, Guam, and Puerto Rico, collected through a combination of landline and cell phone interviews.\" - 2020 Behavioral Risk Factor Surveillance System (BRFSS) annual survey data from the Centers for Disease Control and Prevention (CDC).\n",
    "- What were limitations of your datset? The person answering the survey has a telephone, and voluntarily and accurately answers the survey questions.\n",
    "- Are there any known biases in the data? No. "
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7592fc1e-0623-48f5-8e75-d442c7d30717",
   "metadata": {},
   "source": [
    "Conclusions - people, on average, gain weight from age 18 to roughly age 50, \n",
    "then lose weight for the rest of their lives."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "beneficial-invasion",
   "metadata": {},
   "source": [
    "## Summary"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "a4af7f6f-9e21-4ec2-8b32-b14b0e7cd60b",
   "metadata": {},
   "source": [
    "1) What is the count of people by age? 1st chart. Is this distribution of any significance? No known biases.\n",
    "2) What is the count of people by weight? 2nd chart. Is this distribution of any significance? No known biases.\n",
    "3) What number or percentage can be used to accurately indicate a \n",
    "dramatic change in weight by age? 3rd chart. No dramatic change in weight by age. How do I determine what \"dramatic\" is? It's subjective.\n",
    "4) I want to see the main distribution of weight by age. I want to see where\n",
    "the probable outliers are (Box Plot). 4th chart. There are many outliers on the upside for all age groups. There are very few outliers on the downside for all age groups.\n",
    "5) I want to see the main distribution of weight by age. I want to see the\n",
    "probability density (Violin Plot). 5th chart."
   ]
  }
 ],
 "metadata": {
  "jupytext": {
   "cell_metadata_json": true,
   "text_representation": {
    "extension": ".Rmd",
    "format_name": "rmarkdown",
    "format_version": "1.2",
    "jupytext_version": "1.9.1"
   }
  },
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.3"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": false,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  },
  "varInspector": {
   "cols": {
    "lenName": 16,
    "lenType": 16,
    "lenVar": 40
   },
   "kernels_config": {
    "python": {
     "delete_cmd_postfix": "",
     "delete_cmd_prefix": "del ",
     "library": "var_list.py",
     "varRefreshCmd": "print(var_dic_list())"
    },
    "r": {
     "delete_cmd_postfix": ") ",
     "delete_cmd_prefix": "rm(",
     "library": "var_list.r",
     "varRefreshCmd": "cat(var_dic_list()) "
    }
   },
   "types_to_exclude": [
    "module",
    "function",
    "builtin_function_or_method",
    "instance",
    "_Feature"
   ],
   "window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
