[ADD] week 4 material

This commit is contained in:
Eduardo Cueto Mendoza 2020-05-29 20:09:04 -06:00
parent 06c2fb7ea1
commit f1f66b5d2e
3 changed files with 1903 additions and 29 deletions

File diff suppressed because one or more lines are too long

385
02_Coursera_4.ipynb Normal file
View File

@ -0,0 +1,385 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"using Distributions\n",
"using StatsBase\n",
"using CSV\n",
"using DataFrames\n",
"using HypothesisTests\n",
"using Plots\n",
"using GLM"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"test1 = CSV.read(\"ProjectData_1_point_0.csv\");"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table class=\"data-frame\"><thead><tr><th></th><th>Age</th><th>WCC</th><th>CRP</th><th>Treatment</th><th>Result</th></tr><tr><th></th><th>Int64</th><th>Float64</th><th>Int64</th><th>String</th><th>String</th></tr></thead><tbody><p>100 rows × 5 columns</p><tr><th>1</th><td>39</td><td>9.3</td><td>10</td><td>A</td><td>Worse</td></tr><tr><th>2</th><td>51</td><td>14.6</td><td>50</td><td>A</td><td>Worse</td></tr><tr><th>3</th><td>75</td><td>7.1</td><td>50</td><td>A</td><td>Improved</td></tr><tr><th>4</th><td>59</td><td>12.0</td><td>10</td><td>A</td><td>Improved</td></tr><tr><th>5</th><td>62</td><td>13.6</td><td>60</td><td>A</td><td>Static</td></tr><tr><th>6</th><td>59</td><td>11.9</td><td>30</td><td>B</td><td>Static</td></tr><tr><th>7</th><td>31</td><td>10.6</td><td>10</td><td>B</td><td>Static</td></tr><tr><th>8</th><td>63</td><td>11.8</td><td>70</td><td>A</td><td>Worse</td></tr><tr><th>9</th><td>41</td><td>13.2</td><td>70</td><td>A</td><td>Worse</td></tr><tr><th>10</th><td>45</td><td>13.6</td><td>90</td><td>B</td><td>Worse</td></tr><tr><th>11</th><td>78</td><td>11.8</td><td>70</td><td>B</td><td>Improved</td></tr><tr><th>12</th><td>36</td><td>13.7</td><td>50</td><td>A</td><td>Improved</td></tr><tr><th>13</th><td>62</td><td>9.5</td><td>40</td><td>A</td><td>Static</td></tr><tr><th>14</th><td>34</td><td>13.6</td><td>30</td><td>A</td><td>Static</td></tr><tr><th>15</th><td>70</td><td>14.2</td><td>90</td><td>A</td><td>Static</td></tr><tr><th>16</th><td>54</td><td>12.9</td><td>30</td><td>A</td><td>Improved</td></tr><tr><th>17</th><td>18</td><td>12.3</td><td>20</td><td>B</td><td>Worse</td></tr><tr><th>18</th><td>78</td><td>11.0</td><td>30</td><td>A</td><td>Improved</td></tr><tr><th>19</th><td>53</td><td>12.7</td><td>60</td><td>B</td><td>Worse</td></tr><tr><th>20</th><td>53</td><td>15.5</td><td>100</td><td>A</td><td>Static</td></tr><tr><th>21</th><td>66</td><td>11.4</td><td>70</td><td>A</td><td>Worse</td></tr><tr><th>22</th><td>80</td><td>12.1</td><td>20</td><td>B</td><td>Static</td></tr><tr><th>23</th><td>46</td><td>10.3</td><td>70</td><td>B</td><td>Improved</td></tr><tr><th>24</th><td>58</td><td>10.9</td><td>20</td><td>B</td><td>Improved</td></tr><tr><th>25</th><td>68</td><td>12.2</td><td>20</td><td>B</td><td>Improved</td></tr><tr><th>26</th><td>58</td><td>8.3</td><td>20</td><td>B</td><td>Worse</td></tr><tr><th>27</th><td>20</td><td>11.7</td><td>40</td><td>A</td><td>Worse</td></tr><tr><th>28</th><td>38</td><td>14.8</td><td>60</td><td>A</td><td>Improved</td></tr><tr><th>29</th><td>76</td><td>12.4</td><td>30</td><td>B</td><td>Improved</td></tr><tr><th>30</th><td>23</td><td>4.9</td><td>40</td><td>B</td><td>Static</td></tr><tr><th>&vellip;</th><td>&vellip;</td><td>&vellip;</td><td>&vellip;</td><td>&vellip;</td><td>&vellip;</td></tr></tbody></table>"
],
"text/latex": [
"\\begin{tabular}{r|ccccc}\n",
"\t& Age & WCC & CRP & Treatment & Result\\\\\n",
"\t\\hline\n",
"\t& Int64 & Float64 & Int64 & String & String\\\\\n",
"\t\\hline\n",
"\t1 & 39 & 9.3 & 10 & A & Worse \\\\\n",
"\t2 & 51 & 14.6 & 50 & A & Worse \\\\\n",
"\t3 & 75 & 7.1 & 50 & A & Improved \\\\\n",
"\t4 & 59 & 12.0 & 10 & A & Improved \\\\\n",
"\t5 & 62 & 13.6 & 60 & A & Static \\\\\n",
"\t6 & 59 & 11.9 & 30 & B & Static \\\\\n",
"\t7 & 31 & 10.6 & 10 & B & Static \\\\\n",
"\t8 & 63 & 11.8 & 70 & A & Worse \\\\\n",
"\t9 & 41 & 13.2 & 70 & A & Worse \\\\\n",
"\t10 & 45 & 13.6 & 90 & B & Worse \\\\\n",
"\t11 & 78 & 11.8 & 70 & B & Improved \\\\\n",
"\t12 & 36 & 13.7 & 50 & A & Improved \\\\\n",
"\t13 & 62 & 9.5 & 40 & A & Static \\\\\n",
"\t14 & 34 & 13.6 & 30 & A & Static \\\\\n",
"\t15 & 70 & 14.2 & 90 & A & Static \\\\\n",
"\t16 & 54 & 12.9 & 30 & A & Improved \\\\\n",
"\t17 & 18 & 12.3 & 20 & B & Worse \\\\\n",
"\t18 & 78 & 11.0 & 30 & A & Improved \\\\\n",
"\t19 & 53 & 12.7 & 60 & B & Worse \\\\\n",
"\t20 & 53 & 15.5 & 100 & A & Static \\\\\n",
"\t21 & 66 & 11.4 & 70 & A & Worse \\\\\n",
"\t22 & 80 & 12.1 & 20 & B & Static \\\\\n",
"\t23 & 46 & 10.3 & 70 & B & Improved \\\\\n",
"\t24 & 58 & 10.9 & 20 & B & Improved \\\\\n",
"\t25 & 68 & 12.2 & 20 & B & Improved \\\\\n",
"\t26 & 58 & 8.3 & 20 & B & Worse \\\\\n",
"\t27 & 20 & 11.7 & 40 & A & Worse \\\\\n",
"\t28 & 38 & 14.8 & 60 & A & Improved \\\\\n",
"\t29 & 76 & 12.4 & 30 & B & Improved \\\\\n",
"\t30 & 23 & 4.9 & 40 & B & Static \\\\\n",
"\t$\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ \\\\\n",
"\\end{tabular}\n"
],
"text/plain": [
"100×5 DataFrame\n",
"│ Row │ Age │ WCC │ CRP │ Treatment │ Result │\n",
"│ │ \u001b[90mInt64\u001b[39m │ \u001b[90mFloat64\u001b[39m │ \u001b[90mInt64\u001b[39m │ \u001b[90mString\u001b[39m │ \u001b[90mString\u001b[39m │\n",
"├─────┼───────┼─────────┼───────┼───────────┼──────────┤\n",
"│ 1 │ 39 │ 9.3 │ 10 │ A │ Worse │\n",
"│ 2 │ 51 │ 14.6 │ 50 │ A │ Worse │\n",
"│ 3 │ 75 │ 7.1 │ 50 │ A │ Improved │\n",
"│ 4 │ 59 │ 12.0 │ 10 │ A │ Improved │\n",
"│ 5 │ 62 │ 13.6 │ 60 │ A │ Static │\n",
"│ 6 │ 59 │ 11.9 │ 30 │ B │ Static │\n",
"│ 7 │ 31 │ 10.6 │ 10 │ B │ Static │\n",
"│ 8 │ 63 │ 11.8 │ 70 │ A │ Worse │\n",
"│ 9 │ 41 │ 13.2 │ 70 │ A │ Worse │\n",
"│ 10 │ 45 │ 13.6 │ 90 │ B │ Worse │\n",
"⋮\n",
"│ 90 │ 43 │ 12.5 │ 10 │ A │ Improved │\n",
"│ 91 │ 51 │ 14.1 │ 50 │ A │ Worse │\n",
"│ 92 │ 35 │ 10.2 │ 40 │ B │ Static │\n",
"│ 93 │ 52 │ 13.7 │ 70 │ A │ Worse │\n",
"│ 94 │ 33 │ 11.2 │ 20 │ A │ Improved │\n",
"│ 95 │ 30 │ 12.5 │ 110 │ A │ Worse │\n",
"│ 96 │ 60 │ 12.6 │ 30 │ A │ Static │\n",
"│ 97 │ 25 │ 13.0 │ 20 │ B │ Static │\n",
"│ 98 │ 76 │ 7.1 │ 10 │ A │ Static │\n",
"│ 99 │ 54 │ 16.1 │ 50 │ B │ Improved │\n",
"│ 100 │ 36 │ 11.8 │ 10 │ A │ Worse │"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"test1"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table class=\"data-frame\"><thead><tr><th></th><th>Group</th><th>Variable1</th><th>Variable2</th></tr><tr><th></th><th>String</th><th>Float64</th><th>Float64</th></tr></thead><tbody><p>20 rows × 3 columns</p><tr><th>1</th><td>B</td><td>-0.395164</td><td>0.785108</td></tr><tr><th>2</th><td>A</td><td>-0.477911</td><td>0.94664</td></tr><tr><th>3</th><td>B</td><td>1.3248</td><td>0.683507</td></tr><tr><th>4</th><td>A</td><td>2.18945</td><td>0.655638</td></tr><tr><th>5</th><td>B</td><td>-1.8022</td><td>0.40504</td></tr><tr><th>6</th><td>B</td><td>-0.0415339</td><td>0.0649169</td></tr><tr><th>7</th><td>A</td><td>-0.988776</td><td>0.579329</td></tr><tr><th>8</th><td>B</td><td>0.452246</td><td>0.0049928</td></tr><tr><th>9</th><td>B</td><td>-1.23054</td><td>0.529847</td></tr><tr><th>10</th><td>A</td><td>-0.923378</td><td>0.258118</td></tr><tr><th>11</th><td>B</td><td>0.874476</td><td>0.642472</td></tr><tr><th>12</th><td>A</td><td>-1.02009</td><td>0.0728385</td></tr><tr><th>13</th><td>B</td><td>-0.422106</td><td>0.319547</td></tr><tr><th>14</th><td>B</td><td>0.953726</td><td>0.0257164</td></tr><tr><th>15</th><td>A</td><td>-2.52417</td><td>0.0487641</td></tr><tr><th>16</th><td>B</td><td>0.494937</td><td>0.869764</td></tr><tr><th>17</th><td>A</td><td>1.47704</td><td>0.824756</td></tr><tr><th>18</th><td>A</td><td>-0.133367</td><td>0.875263</td></tr><tr><th>19</th><td>B</td><td>-0.906293</td><td>0.0709776</td></tr><tr><th>20</th><td>B</td><td>-0.36659</td><td>0.452148</td></tr></tbody></table>"
],
"text/latex": [
"\\begin{tabular}{r|ccc}\n",
"\t& Group & Variable1 & Variable2\\\\\n",
"\t\\hline\n",
"\t& String & Float64 & Float64\\\\\n",
"\t\\hline\n",
"\t1 & B & -0.395164 & 0.785108 \\\\\n",
"\t2 & A & -0.477911 & 0.94664 \\\\\n",
"\t3 & B & 1.3248 & 0.683507 \\\\\n",
"\t4 & A & 2.18945 & 0.655638 \\\\\n",
"\t5 & B & -1.8022 & 0.40504 \\\\\n",
"\t6 & B & -0.0415339 & 0.0649169 \\\\\n",
"\t7 & A & -0.988776 & 0.579329 \\\\\n",
"\t8 & B & 0.452246 & 0.0049928 \\\\\n",
"\t9 & B & -1.23054 & 0.529847 \\\\\n",
"\t10 & A & -0.923378 & 0.258118 \\\\\n",
"\t11 & B & 0.874476 & 0.642472 \\\\\n",
"\t12 & A & -1.02009 & 0.0728385 \\\\\n",
"\t13 & B & -0.422106 & 0.319547 \\\\\n",
"\t14 & B & 0.953726 & 0.0257164 \\\\\n",
"\t15 & A & -2.52417 & 0.0487641 \\\\\n",
"\t16 & B & 0.494937 & 0.869764 \\\\\n",
"\t17 & A & 1.47704 & 0.824756 \\\\\n",
"\t18 & A & -0.133367 & 0.875263 \\\\\n",
"\t19 & B & -0.906293 & 0.0709776 \\\\\n",
"\t20 & B & -0.36659 & 0.452148 \\\\\n",
"\\end{tabular}\n"
],
"text/plain": [
"20×3 DataFrame\n",
"│ Row │ Group │ Variable1 │ Variable2 │\n",
"│ │ \u001b[90mString\u001b[39m │ \u001b[90mFloat64\u001b[39m │ \u001b[90mFloat64\u001b[39m │\n",
"├─────┼────────┼────────────┼───────────┤\n",
"│ 1 │ B │ -0.395164 │ 0.785108 │\n",
"│ 2 │ A │ -0.477911 │ 0.94664 │\n",
"│ 3 │ B │ 1.3248 │ 0.683507 │\n",
"│ 4 │ A │ 2.18945 │ 0.655638 │\n",
"│ 5 │ B │ -1.8022 │ 0.40504 │\n",
"│ 6 │ B │ -0.0415339 │ 0.0649169 │\n",
"│ 7 │ A │ -0.988776 │ 0.579329 │\n",
"│ 8 │ B │ 0.452246 │ 0.0049928 │\n",
"│ 9 │ B │ -1.23054 │ 0.529847 │\n",
"│ 10 │ A │ -0.923378 │ 0.258118 │\n",
"│ 11 │ B │ 0.874476 │ 0.642472 │\n",
"│ 12 │ A │ -1.02009 │ 0.0728385 │\n",
"│ 13 │ B │ -0.422106 │ 0.319547 │\n",
"│ 14 │ B │ 0.953726 │ 0.0257164 │\n",
"│ 15 │ A │ -2.52417 │ 0.0487641 │\n",
"│ 16 │ B │ 0.494937 │ 0.869764 │\n",
"│ 17 │ A │ 1.47704 │ 0.824756 │\n",
"│ 18 │ A │ -0.133367 │ 0.875263 │\n",
"│ 19 │ B │ -0.906293 │ 0.0709776 │\n",
"│ 20 │ B │ -0.36659 │ 0.452148 │"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"DataFrame(Group=rand([\"A\", \"B\"], 20), Variable1=randn(20), Variable2=rand(20))"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<p>DataFrameRow (5 columns)</p><table class=\"data-frame\"><thead><tr><th></th><th>Age</th><th>WCC</th><th>CRP</th><th>Treatment</th><th>Result</th></tr><tr><th></th><th>Int64</th><th>Float64</th><th>Int64</th><th>String</th><th>String</th></tr></thead><tbody><tr><th>3</th><td>75</td><td>7.1</td><td>50</td><td>A</td><td>Improved</td></tr></tbody></table>"
],
"text/latex": [
"\\begin{tabular}{r|ccccc}\n",
"\t& Age & WCC & CRP & Treatment & Result\\\\\n",
"\t\\hline\n",
"\t& Int64 & Float64 & Int64 & String & String\\\\\n",
"\t\\hline\n",
"\t3 & 75 & 7.1 & 50 & A & Improved \\\\\n",
"\\end{tabular}\n"
],
"text/plain": [
"DataFrameRow\n",
"│ Row │ Age │ WCC │ CRP │ Treatment │ Result │\n",
"│ │ \u001b[90mInt64\u001b[39m │ \u001b[90mFloat64\u001b[39m │ \u001b[90mInt64\u001b[39m │ \u001b[90mString\u001b[39m │ \u001b[90mString\u001b[39m │\n",
"├─────┼───────┼─────────┼───────┼───────────┼──────────┤\n",
"│ 3 │ 75 │ 7.1 │ 50 │ A │ Improved │"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"view(test1,3,:)"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table class=\"data-frame\"><thead><tr><th></th><th>Age</th><th>WCC</th><th>CRP</th><th>Treatment</th><th>Result</th></tr><tr><th></th><th>Int64</th><th>Float64</th><th>Int64</th><th>String</th><th>String</th></tr></thead><tbody><p>97 rows × 5 columns</p><tr><th>1</th><td>39</td><td>9.3</td><td>10</td><td>A</td><td>Worse</td></tr><tr><th>2</th><td>51</td><td>14.6</td><td>50</td><td>A</td><td>Worse</td></tr><tr><th>3</th><td>59</td><td>12.0</td><td>10</td><td>A</td><td>Improved</td></tr><tr><th>4</th><td>59</td><td>11.9</td><td>30</td><td>B</td><td>Static</td></tr><tr><th>5</th><td>31</td><td>10.6</td><td>10</td><td>B</td><td>Static</td></tr><tr><th>6</th><td>63</td><td>11.8</td><td>70</td><td>A</td><td>Worse</td></tr><tr><th>7</th><td>45</td><td>13.6</td><td>90</td><td>B</td><td>Worse</td></tr><tr><th>8</th><td>78</td><td>11.8</td><td>70</td><td>B</td><td>Improved</td></tr><tr><th>9</th><td>36</td><td>13.7</td><td>50</td><td>A</td><td>Improved</td></tr><tr><th>10</th><td>62</td><td>9.5</td><td>40</td><td>A</td><td>Static</td></tr><tr><th>11</th><td>34</td><td>13.6</td><td>30</td><td>A</td><td>Static</td></tr><tr><th>12</th><td>70</td><td>14.2</td><td>90</td><td>A</td><td>Static</td></tr><tr><th>13</th><td>54</td><td>12.9</td><td>30</td><td>A</td><td>Improved</td></tr><tr><th>14</th><td>18</td><td>12.3</td><td>20</td><td>B</td><td>Worse</td></tr><tr><th>15</th><td>78</td><td>11.0</td><td>30</td><td>A</td><td>Improved</td></tr><tr><th>16</th><td>53</td><td>12.7</td><td>60</td><td>B</td><td>Worse</td></tr><tr><th>17</th><td>53</td><td>15.5</td><td>100</td><td>A</td><td>Static</td></tr><tr><th>18</th><td>66</td><td>11.4</td><td>70</td><td>A</td><td>Worse</td></tr><tr><th>19</th><td>80</td><td>12.1</td><td>20</td><td>B</td><td>Static</td></tr><tr><th>20</th><td>46</td><td>10.3</td><td>70</td><td>B</td><td>Improved</td></tr><tr><th>21</th><td>58</td><td>10.9</td><td>20</td><td>B</td><td>Improved</td></tr><tr><th>22</th><td>68</td><td>12.2</td><td>20</td><td>B</td><td>Improved</td></tr><tr><th>23</th><td>58</td><td>8.3</td><td>20</td><td>B</td><td>Worse</td></tr><tr><th>24</th><td>20</td><td>11.7</td><td>40</td><td>A</td><td>Worse</td></tr><tr><th>25</th><td>38</td><td>14.8</td><td>60</td><td>A</td><td>Improved</td></tr><tr><th>26</th><td>76</td><td>12.4</td><td>30</td><td>B</td><td>Improved</td></tr><tr><th>27</th><td>23</td><td>4.9</td><td>40</td><td>B</td><td>Static</td></tr><tr><th>28</th><td>80</td><td>13.7</td><td>80</td><td>B</td><td>Static</td></tr><tr><th>29</th><td>65</td><td>12.4</td><td>10</td><td>B</td><td>Improved</td></tr><tr><th>30</th><td>22</td><td>14.7</td><td>10</td><td>B</td><td>Improved</td></tr><tr><th>&vellip;</th><td>&vellip;</td><td>&vellip;</td><td>&vellip;</td><td>&vellip;</td><td>&vellip;</td></tr></tbody></table>"
],
"text/latex": [
"\\begin{tabular}{r|ccccc}\n",
"\t& Age & WCC & CRP & Treatment & Result\\\\\n",
"\t\\hline\n",
"\t& Int64 & Float64 & Int64 & String & String\\\\\n",
"\t\\hline\n",
"\t1 & 39 & 9.3 & 10 & A & Worse \\\\\n",
"\t2 & 51 & 14.6 & 50 & A & Worse \\\\\n",
"\t3 & 59 & 12.0 & 10 & A & Improved \\\\\n",
"\t4 & 59 & 11.9 & 30 & B & Static \\\\\n",
"\t5 & 31 & 10.6 & 10 & B & Static \\\\\n",
"\t6 & 63 & 11.8 & 70 & A & Worse \\\\\n",
"\t7 & 45 & 13.6 & 90 & B & Worse \\\\\n",
"\t8 & 78 & 11.8 & 70 & B & Improved \\\\\n",
"\t9 & 36 & 13.7 & 50 & A & Improved \\\\\n",
"\t10 & 62 & 9.5 & 40 & A & Static \\\\\n",
"\t11 & 34 & 13.6 & 30 & A & Static \\\\\n",
"\t12 & 70 & 14.2 & 90 & A & Static \\\\\n",
"\t13 & 54 & 12.9 & 30 & A & Improved \\\\\n",
"\t14 & 18 & 12.3 & 20 & B & Worse \\\\\n",
"\t15 & 78 & 11.0 & 30 & A & Improved \\\\\n",
"\t16 & 53 & 12.7 & 60 & B & Worse \\\\\n",
"\t17 & 53 & 15.5 & 100 & A & Static \\\\\n",
"\t18 & 66 & 11.4 & 70 & A & Worse \\\\\n",
"\t19 & 80 & 12.1 & 20 & B & Static \\\\\n",
"\t20 & 46 & 10.3 & 70 & B & Improved \\\\\n",
"\t21 & 58 & 10.9 & 20 & B & Improved \\\\\n",
"\t22 & 68 & 12.2 & 20 & B & Improved \\\\\n",
"\t23 & 58 & 8.3 & 20 & B & Worse \\\\\n",
"\t24 & 20 & 11.7 & 40 & A & Worse \\\\\n",
"\t25 & 38 & 14.8 & 60 & A & Improved \\\\\n",
"\t26 & 76 & 12.4 & 30 & B & Improved \\\\\n",
"\t27 & 23 & 4.9 & 40 & B & Static \\\\\n",
"\t28 & 80 & 13.7 & 80 & B & Static \\\\\n",
"\t29 & 65 & 12.4 & 10 & B & Improved \\\\\n",
"\t30 & 22 & 14.7 & 10 & B & Improved \\\\\n",
"\t$\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ \\\\\n",
"\\end{tabular}\n"
],
"text/plain": [
"97×5 DataFrame\n",
"│ Row │ Age │ WCC │ CRP │ Treatment │ Result │\n",
"│ │ \u001b[90mInt64\u001b[39m │ \u001b[90mFloat64\u001b[39m │ \u001b[90mInt64\u001b[39m │ \u001b[90mString\u001b[39m │ \u001b[90mString\u001b[39m │\n",
"├─────┼───────┼─────────┼───────┼───────────┼──────────┤\n",
"│ 1 │ 39 │ 9.3 │ 10 │ A │ Worse │\n",
"│ 2 │ 51 │ 14.6 │ 50 │ A │ Worse │\n",
"│ 3 │ 59 │ 12.0 │ 10 │ A │ Improved │\n",
"│ 4 │ 59 │ 11.9 │ 30 │ B │ Static │\n",
"│ 5 │ 31 │ 10.6 │ 10 │ B │ Static │\n",
"│ 6 │ 63 │ 11.8 │ 70 │ A │ Worse │\n",
"│ 7 │ 45 │ 13.6 │ 90 │ B │ Worse │\n",
"│ 8 │ 78 │ 11.8 │ 70 │ B │ Improved │\n",
"│ 9 │ 36 │ 13.7 │ 50 │ A │ Improved │\n",
"│ 10 │ 62 │ 9.5 │ 40 │ A │ Static │\n",
"⋮\n",
"│ 87 │ 43 │ 12.5 │ 10 │ A │ Improved │\n",
"│ 88 │ 51 │ 14.1 │ 50 │ A │ Worse │\n",
"│ 89 │ 35 │ 10.2 │ 40 │ B │ Static │\n",
"│ 90 │ 52 │ 13.7 │ 70 │ A │ Worse │\n",
"│ 91 │ 33 │ 11.2 │ 20 │ A │ Improved │\n",
"│ 92 │ 30 │ 12.5 │ 110 │ A │ Worse │\n",
"│ 93 │ 60 │ 12.6 │ 30 │ A │ Static │\n",
"│ 94 │ 25 │ 13.0 │ 20 │ B │ Static │\n",
"│ 95 │ 76 │ 7.1 │ 10 │ A │ Static │\n",
"│ 96 │ 54 │ 16.1 │ 50 │ B │ Improved │\n",
"│ 97 │ 36 │ 11.8 │ 10 │ A │ Worse │"
]
},
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"test1[[1:2;4:4;6:8;10:end],:]"
]
},
{
"cell_type": "code",
"execution_count": 19,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"101.20293783633616"
]
},
"execution_count": 19,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"var(rand(Normal(80, 10), 200))"
]
},
{
"cell_type": "code",
"execution_count": 21,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"-0.0520584551299503"
]
},
"execution_count": 21,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"mean(randn(100))"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"TDist()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"EqualVarianceTTest()"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Julia 1.2.0",
"language": "julia",
"name": "julia-1.2"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.2.0"
}
},
"nbformat": 4,
"nbformat_minor": 4
}

101
ProjectData_1_point_0.csv Normal file
View File

@ -0,0 +1,101 @@
Age,WCC,CRP,Treatment,Result
39,9.3,10,A,Worse
51,14.6,50,A,Worse
75,7.1,50,A,Improved
59,12.0,10,A,Improved
62,13.6,60,A,Static
59,11.9,30,B,Static
31,10.6,10,B,Static
63,11.8,70,A,Worse
41,13.2,70,A,Worse
45,13.6,90,B,Worse
78,11.8,70,B,Improved
36,13.7,50,A,Improved
62,9.5,40,A,Static
34,13.6,30,A,Static
70,14.2,90,A,Static
54,12.9,30,A,Improved
18,12.3,20,B,Worse
78,11.0,30,A,Improved
53,12.7,60,B,Worse
53,15.5,100,A,Static
66,11.4,70,A,Worse
80,12.1,20,B,Static
46,10.3,70,B,Improved
58,10.9,20,B,Improved
68,12.2,20,B,Improved
58,8.3,20,B,Worse
20,11.7,40,A,Worse
38,14.8,60,A,Improved
76,12.4,30,B,Improved
23,4.9,40,B,Static
80,13.7,80,B,Static
65,12.4,10,B,Improved
22,14.7,10,B,Improved
43,14.5,80,A,Static
26,7.9,10,A,Improved
63,9.5,50,A,Improved
48,12.4,30,A,Improved
46,11.1,100,A,Static
52,11.5,10,B,Improved
60,9.5,120,B,Worse
58,10.0,20,A,Worse
56,11.7,30,A,Improved
64,10.8,40,A,Worse
41,12.3,60,A,Worse
37,11.1,80,B,Improved
45,14.0,80,B,Improved
69,10.6,50,B,Static
56,9.5,50,B,Improved
59,14.2,30,B,Worse
65,14.5,70,B,Worse
32,15.4,20,A,Improved
29,11.7,20,A,Improved
49,11.8,80,A,Improved
74,13.3,60,A,Static
80,10.9,20,A,Improved
57,13.6,20,B,Static
65,15.0,10,A,Improved
56,12.6,40,A,Static
71,11.5,90,A,Static
49,13.0,40,A,Static
32,15.6,40,A,Improved
40,12.5,40,B,Improved
31,12.7,30,A,Improved
63,9.7,30,B,Static
77,14.5,40,A,Static
18,10.0,70,B,Worse
49,6.1,50,A,Static
30,14.2,50,B,Improved
44,9.7,70,B,Static
45,12.8,110,A,Worse
29,11.7,80,B,Worse
49,12.2,40,A,Improved
59,10.5,20,A,Static
33,12.9,10,B,Worse
66,12.6,30,A,Static
67,13.8,110,A,Static
27,11.9,20,B,Improved
19,13.1,100,B,Worse
49,14.9,40,B,Worse
52,11.8,20,A,Worse
45,12.2,70,A,Static
76,13.4,30,A,Worse
34,12.5,40,A,Static
58,12.7,60,A,Improved
47,13.2,40,B,Worse
38,12.0,210,B,Worse
24,13.4,40,A,Static
39,11.0,30,A,Static
45,13.5,20,A,Worse
43,12.5,10,A,Improved
51,14.1,50,A,Worse
35,10.2,40,B,Static
52,13.7,70,A,Worse
33,11.2,20,A,Improved
30,12.5,110,A,Worse
60,12.6,30,A,Static
25,13.0,20,B,Static
76,7.1,10,A,Static
54,16.1,50,B,Improved
36,11.8,10,A,Worse
1 Age WCC CRP Treatment Result
2 39 9.3 10 A Worse
3 51 14.6 50 A Worse
4 75 7.1 50 A Improved
5 59 12.0 10 A Improved
6 62 13.6 60 A Static
7 59 11.9 30 B Static
8 31 10.6 10 B Static
9 63 11.8 70 A Worse
10 41 13.2 70 A Worse
11 45 13.6 90 B Worse
12 78 11.8 70 B Improved
13 36 13.7 50 A Improved
14 62 9.5 40 A Static
15 34 13.6 30 A Static
16 70 14.2 90 A Static
17 54 12.9 30 A Improved
18 18 12.3 20 B Worse
19 78 11.0 30 A Improved
20 53 12.7 60 B Worse
21 53 15.5 100 A Static
22 66 11.4 70 A Worse
23 80 12.1 20 B Static
24 46 10.3 70 B Improved
25 58 10.9 20 B Improved
26 68 12.2 20 B Improved
27 58 8.3 20 B Worse
28 20 11.7 40 A Worse
29 38 14.8 60 A Improved
30 76 12.4 30 B Improved
31 23 4.9 40 B Static
32 80 13.7 80 B Static
33 65 12.4 10 B Improved
34 22 14.7 10 B Improved
35 43 14.5 80 A Static
36 26 7.9 10 A Improved
37 63 9.5 50 A Improved
38 48 12.4 30 A Improved
39 46 11.1 100 A Static
40 52 11.5 10 B Improved
41 60 9.5 120 B Worse
42 58 10.0 20 A Worse
43 56 11.7 30 A Improved
44 64 10.8 40 A Worse
45 41 12.3 60 A Worse
46 37 11.1 80 B Improved
47 45 14.0 80 B Improved
48 69 10.6 50 B Static
49 56 9.5 50 B Improved
50 59 14.2 30 B Worse
51 65 14.5 70 B Worse
52 32 15.4 20 A Improved
53 29 11.7 20 A Improved
54 49 11.8 80 A Improved
55 74 13.3 60 A Static
56 80 10.9 20 A Improved
57 57 13.6 20 B Static
58 65 15.0 10 A Improved
59 56 12.6 40 A Static
60 71 11.5 90 A Static
61 49 13.0 40 A Static
62 32 15.6 40 A Improved
63 40 12.5 40 B Improved
64 31 12.7 30 A Improved
65 63 9.7 30 B Static
66 77 14.5 40 A Static
67 18 10.0 70 B Worse
68 49 6.1 50 A Static
69 30 14.2 50 B Improved
70 44 9.7 70 B Static
71 45 12.8 110 A Worse
72 29 11.7 80 B Worse
73 49 12.2 40 A Improved
74 59 10.5 20 A Static
75 33 12.9 10 B Worse
76 66 12.6 30 A Static
77 67 13.8 110 A Static
78 27 11.9 20 B Improved
79 19 13.1 100 B Worse
80 49 14.9 40 B Worse
81 52 11.8 20 A Worse
82 45 12.2 70 A Static
83 76 13.4 30 A Worse
84 34 12.5 40 A Static
85 58 12.7 60 A Improved
86 47 13.2 40 B Worse
87 38 12.0 210 B Worse
88 24 13.4 40 A Static
89 39 11.0 30 A Static
90 45 13.5 20 A Worse
91 43 12.5 10 A Improved
92 51 14.1 50 A Worse
93 35 10.2 40 B Static
94 52 13.7 70 A Worse
95 33 11.2 20 A Improved
96 30 12.5 110 A Worse
97 60 12.6 30 A Static
98 25 13.0 20 B Static
99 76 7.1 10 A Static
100 54 16.1 50 B Improved
101 36 11.8 10 A Worse