julia_coursera/01_Coursera_4.ipynb

1489 lines
380 KiB
Plaintext
Raw Permalink Normal View History

2020-05-29 18:37:25 +00:00
{
"cells": [
{
"cell_type": "code",
2020-05-30 02:09:04 +00:00
"execution_count": 3,
2020-05-29 18:37:25 +00:00
"metadata": {},
"outputs": [
2020-05-30 02:09:04 +00:00
{
"name": "stderr",
"output_type": "stream",
"text": [
"┌ Info: Precompiling Distributions [31c24e10-a181-5473-b8eb-7969acd0382f]\n",
"└ @ Base loading.jl:1242\n",
"┌ Info: Precompiling CSV [336ed68f-0bac-5ca0-87d4-7b16caf5d00b]\n",
"└ @ Base loading.jl:1242\n",
"┌ Info: Precompiling HypothesisTests [09f84164-cd44-5f33-b23f-e6b0d136a0d5]\n",
"└ @ Base loading.jl:1242\n",
"┌ Info: Recompiling stale cache file /Users/eddie/.julia/compiled/v1.2/Plots/ld3vC.ji for Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80]\n",
"└ @ Base loading.jl:1240\n",
"┌ Info: Precompiling GLM [38e38edf-8417-5370-95a0-9cbb8c7f171a]\n",
"└ @ Base loading.jl:1242\n"
]
}
],
"source": [
"using Distributions\n",
"using StatsBase\n",
"using CSV\n",
"using DataFrames\n",
"using HypothesisTests\n",
"using Plots\n",
"using GLM\n"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"┌ Info: Precompiling PyPlot [d330b81b-6aea-500a-939a-2ce795aea3ee]\n",
"└ @ Base loading.jl:1242\n",
"┌ Info: Installing matplotlib via the Conda matplotlib package...\n",
"└ @ PyCall /Users/eddie/.julia/packages/PyCall/zqDXB/src/PyCall.jl:697\n",
"┌ Info: Running `conda install -y matplotlib` in root environment\n",
"└ @ Conda /Users/eddie/.julia/packages/Conda/3rPhK/src/Conda.jl:113\n"
]
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Collecting package metadata (current_repodata.json): ...working... done\n",
"Solving environment: ...working... done\n",
"\n",
"## Package Plan ##\n",
"\n",
" environment location: /Users/eddie/.julia/conda/3\n",
"\n",
" added / updated specs:\n",
" - matplotlib\n",
"\n",
"\n",
"The following packages will be downloaded:\n",
"\n",
" package | build\n",
" ---------------------------|-----------------\n",
" cycler-0.10.0 | py37_0 14 KB\n",
" freetype-2.9.1 | hb4e5f40_0 555 KB\n",
" kiwisolver-1.2.0 | py37h04f5b5a_0 55 KB\n",
" libpng-1.6.37 | ha441bb4_0 262 KB\n",
" matplotlib-3.1.3 | py37_0 21 KB\n",
" matplotlib-base-3.1.3 | py37h9aa3819_0 4.9 MB\n",
" pyparsing-2.4.7 | py_0 65 KB\n",
" python-dateutil-2.8.1 | py_0 215 KB\n",
" tornado-6.0.4 | py37h1de35cc_1 597 KB\n",
" ------------------------------------------------------------\n",
" Total: 6.7 MB\n",
"\n",
"The following NEW packages will be INSTALLED:\n",
"\n",
" cycler pkgs/main/osx-64::cycler-0.10.0-py37_0\n",
" freetype pkgs/main/osx-64::freetype-2.9.1-hb4e5f40_0\n",
" kiwisolver pkgs/main/osx-64::kiwisolver-1.2.0-py37h04f5b5a_0\n",
" libpng pkgs/main/osx-64::libpng-1.6.37-ha441bb4_0\n",
" matplotlib pkgs/main/osx-64::matplotlib-3.1.3-py37_0\n",
" matplotlib-base pkgs/main/osx-64::matplotlib-base-3.1.3-py37h9aa3819_0\n",
" pyparsing pkgs/main/noarch::pyparsing-2.4.7-py_0\n",
" python-dateutil pkgs/main/noarch::python-dateutil-2.8.1-py_0\n",
" tornado pkgs/main/osx-64::tornado-6.0.4-py37h1de35cc_1\n",
"\n",
"\n",
"\n",
"Downloading and Extracting Packages\n",
"cycler-0.10.0 | 14 KB | ########## | 100% \n",
"python-dateutil-2.8. | 215 KB | ########## | 100% \n",
"pyparsing-2.4.7 | 65 KB | ########## | 100% \n",
"tornado-6.0.4 | 597 KB | ########## | 100% \n",
"matplotlib-base-3.1. | 4.9 MB | ########## | 100% \n",
"freetype-2.9.1 | 555 KB | ########## | 100% \n",
"kiwisolver-1.2.0 | 55 KB | ########## | 100% \n",
"libpng-1.6.37 | 262 KB | ########## | 100% \n",
"matplotlib-3.1.3 | 21 KB | ########## | 100% \n",
"Preparing transaction: ...working... done\n",
"Verifying transaction: ...working... done\n",
"Executing transaction: ...working... done\n"
]
},
{
"data": {
"text/plain": [
"Plots.PyPlotBackend()"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"pyplot()"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"age = rand(18:80,100)\n",
"wcc = round.(rand(Distributions.Normal(12,2),100), digits=1)\n",
"crp = round.(Int, rand(Distributions.Chisq(4),100)) .* 10\n",
"treatment = rand([\"A\",\"B\"],100)\n",
"result = rand([\"Improved\", \"Static\", \"Worse\"],100);\n"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"49.91"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"mean(age)"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"50.0"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"median(age)"
]
},
{
"cell_type": "code",
"execution_count": 12,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"16.537740737079798"
]
},
"execution_count": 12,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"std(age)"
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"12.105"
]
},
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"mean(wcc)"
]
},
{
"cell_type": "code",
"execution_count": 14,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"2.0415568925343583"
]
},
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"std(wcc)"
]
},
{
"cell_type": "code",
"execution_count": 10,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Summary Stats:\n",
"Length: 100\n",
"Missing Count: 0\n",
"Mean: 49.910000\n",
"Minimum: 18.000000\n",
"1st Quartile: 36.750000\n",
"Median: 50.000000\n",
"3rd Quartile: 62.250000\n",
"Maximum: 80.000000\n",
"Type: Int64\n"
]
}
],
"source": [
"StatsBase.describe(age)"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Summary Stats:\n",
"Length: 100\n",
"Missing Count: 0\n",
"Mean: 12.105000\n",
"Minimum: 4.900000\n",
"1st Quartile: 11.075000\n",
"Median: 12.350000\n",
"3rd Quartile: 13.525000\n",
"Maximum: 16.100000\n",
"Type: Float64\n"
]
}
],
"source": [
"StatsBase.describe(wcc)"
]
},
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Summary Stats:\n",
"Length: 100\n",
"Missing Count: 0\n",
"Mean: 12.105000\n",
"Minimum: 4.900000\n",
"1st Quartile: 11.075000\n",
"Median: 12.350000\n",
"3rd Quartile: 13.525000\n",
"Maximum: 16.100000\n"
]
},
"execution_count": 16,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"StatsBase.summarystats(wcc)"
]
},
{
"cell_type": "code",
"execution_count": 23,
"metadata": {},
"outputs": [],
"source": [
"data = DataFrame(Age = age, WCC = wcc, CRP= crp, Treatment = treatment, Result = result);"
]
},
{
"cell_type": "code",
"execution_count": 24,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(100, 5)"
]
},
"execution_count": 24,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"size(data)"
]
},
{
"cell_type": "code",
"execution_count": 25,
"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>6 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></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",
"\\end{tabular}\n"
],
"text/plain": [
"6×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 │"
]
},
"execution_count": 25,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"first(data,6)"
]
},
{
"cell_type": "code",
"execution_count": 40,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"┌ Warning: `getindex(df::DataFrame, col_ind::ColumnIndex)` is deprecated, use `df[!, col_ind]` instead.\n",
"│ caller = top-level scope at In[40]:1\n",
"└ @ Core In[40]:1\n",
"┌ Warning: `getindex(df::DataFrame, col_ind::ColumnIndex)` is deprecated, use `df[!, col_ind]` instead.\n",
"│ caller = top-level scope at In[40]:2\n",
"└ @ Core In[40]:2\n"
]
}
],
"source": [
"dataA = data[data[:Treatment] .== \"A\",:]\n",
"dataB = data[data[:Treatment] .== \"B\",:];"
]
},
{
"cell_type": "code",
"execution_count": 29,
"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>6 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>63</td><td>11.8</td><td>70</td><td>A</td><td>Worse</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 & 63 & 11.8 & 70 & A & Worse \\\\\n",
"\\end{tabular}\n"
],
"text/plain": [
"6×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 │ 63 │ 11.8 │ 70 │ A │ Worse │"
]
},
"execution_count": 29,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"first(dataA,6)"
]
},
{
"cell_type": "code",
"execution_count": 30,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table class=\"data-frame\"><thead><tr><th></th><th>variable</th><th>mean</th><th>min</th><th>median</th><th>max</th><th>nunique</th><th>nmissing</th><th>eltype</th></tr><tr><th></th><th>Symbol</th><th>Union…</th><th>Any</th><th>Union…</th><th>Any</th><th>Union…</th><th>Nothing</th><th>DataType</th></tr></thead><tbody><p>5 rows × 8 columns</p><tr><th>1</th><td>Age</td><td>49.91</td><td>18</td><td>50.0</td><td>80</td><td></td><td></td><td>Int64</td></tr><tr><th>2</th><td>WCC</td><td>12.105</td><td>4.9</td><td>12.35</td><td>16.1</td><td></td><td></td><td>Float64</td></tr><tr><th>3</th><td>CRP</td><td>47.3</td><td>10</td><td>40.0</td><td>210</td><td></td><td></td><td>Int64</td></tr><tr><th>4</th><td>Treatment</td><td></td><td>A</td><td></td><td>B</td><td>2</td><td></td><td>String</td></tr><tr><th>5</th><td>Result</td><td></td><td>Improved</td><td></td><td>Worse</td><td>3</td><td></td><td>String</td></tr></tbody></table>"
],
"text/latex": [
"\\begin{tabular}{r|cccccccc}\n",
"\t& variable & mean & min & median & max & nunique & nmissing & eltype\\\\\n",
"\t\\hline\n",
"\t& Symbol & Union… & Any & Union… & Any & Union… & Nothing & DataType\\\\\n",
"\t\\hline\n",
"\t1 & Age & 49.91 & 18 & 50.0 & 80 & & & Int64 \\\\\n",
"\t2 & WCC & 12.105 & 4.9 & 12.35 & 16.1 & & & Float64 \\\\\n",
"\t3 & CRP & 47.3 & 10 & 40.0 & 210 & & & Int64 \\\\\n",
"\t4 & Treatment & & A & & B & 2 & & String \\\\\n",
"\t5 & Result & & Improved & & Worse & 3 & & String \\\\\n",
"\\end{tabular}\n"
],
"text/plain": [
"5×8 DataFrame. Omitted printing of 1 columns\n",
"│ Row │ variable │ mean │ min │ median │ max │ nunique │ nmissing │\n",
"│ │ \u001b[90mSymbol\u001b[39m │ \u001b[90mUnion…\u001b[39m │ \u001b[90mAny\u001b[39m │ \u001b[90mUnion…\u001b[39m │ \u001b[90mAny\u001b[39m │ \u001b[90mUnion…\u001b[39m │ \u001b[90mNothing\u001b[39m │\n",
"├─────┼───────────┼────────┼──────────┼────────┼───────┼─────────┼──────────┤\n",
"│ 1 │ Age │ 49.91 │ 18 │ 50.0 │ 80 │ │ │\n",
"│ 2 │ WCC │ 12.105 │ 4.9 │ 12.35 │ 16.1 │ │ │\n",
"│ 3 │ CRP │ 47.3 │ 10 │ 40.0 │ 210 │ │ │\n",
"│ 4 │ Treatment │ │ A │ │ B │ 2 │ │\n",
"│ 5 │ Result │ │ Improved │ │ Worse │ 3 │ │"
]
},
"execution_count": 30,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"describe(data)"
]
},
{
"cell_type": "code",
"execution_count": 34,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table class=\"data-frame\"><thead><tr><th></th><th>Treatment</th><th>N</th></tr><tr><th></th><th>String</th><th>Int64</th></tr></thead><tbody><p>2 rows × 2 columns</p><tr><th>1</th><td>A</td><td>60</td></tr><tr><th>2</th><td>B</td><td>40</td></tr></tbody></table>"
],
"text/latex": [
"\\begin{tabular}{r|cc}\n",
"\t& Treatment & N\\\\\n",
"\t\\hline\n",
"\t& String & Int64\\\\\n",
"\t\\hline\n",
"\t1 & A & 60 \\\\\n",
"\t2 & B & 40 \\\\\n",
"\\end{tabular}\n"
],
"text/plain": [
"2×2 DataFrame\n",
"│ Row │ Treatment │ N │\n",
"│ │ \u001b[90mString\u001b[39m │ \u001b[90mInt64\u001b[39m │\n",
"├─────┼───────────┼───────┤\n",
"│ 1 │ A │ 60 │\n",
"│ 2 │ B │ 40 │"
]
},
"execution_count": 34,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"combine(df -> DataFrame(N = size(df,1)), groupby(data, :Treatment))"
]
},
{
"cell_type": "code",
"execution_count": 35,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table class=\"data-frame\"><thead><tr><th></th><th>Treatment</th><th>x1</th></tr><tr><th></th><th>String</th><th>Float64</th></tr></thead><tbody><p>2 rows × 2 columns</p><tr><th>1</th><td>A</td><td>51.3333</td></tr><tr><th>2</th><td>B</td><td>47.775</td></tr></tbody></table>"
],
"text/latex": [
"\\begin{tabular}{r|cc}\n",
"\t& Treatment & x1\\\\\n",
"\t\\hline\n",
"\t& String & Float64\\\\\n",
"\t\\hline\n",
"\t1 & A & 51.3333 \\\\\n",
"\t2 & B & 47.775 \\\\\n",
"\\end{tabular}\n"
],
"text/plain": [
"2×2 DataFrame\n",
"│ Row │ Treatment │ x1 │\n",
"│ │ \u001b[90mString\u001b[39m │ \u001b[90mFloat64\u001b[39m │\n",
"├─────┼───────────┼─────────┤\n",
"│ 1 │ A │ 51.3333 │\n",
"│ 2 │ B │ 47.775 │"
]
},
"execution_count": 35,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"combine(df -> mean(df.Age), groupby(data, :Treatment))"
]
},
{
"cell_type": "code",
"execution_count": 36,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table class=\"data-frame\"><thead><tr><th></th><th>Treatment</th><th>x1</th></tr><tr><th></th><th>String</th><th>Tuple…</th></tr></thead><tbody><p>2 rows × 2 columns</p><tr><th>1</th><td>A</td><td>(60, 5)</td></tr><tr><th>2</th><td>B</td><td>(40, 5)</td></tr></tbody></table>"
],
"text/latex": [
"\\begin{tabular}{r|cc}\n",
"\t& Treatment & x1\\\\\n",
"\t\\hline\n",
"\t& String & Tuple…\\\\\n",
"\t\\hline\n",
"\t1 & A & (60, 5) \\\\\n",
"\t2 & B & (40, 5) \\\\\n",
"\\end{tabular}\n"
],
"text/plain": [
"2×2 DataFrame\n",
"│ Row │ Treatment │ x1 │\n",
"│ │ \u001b[90mString\u001b[39m │ \u001b[90mTuple…\u001b[39m │\n",
"├─────┼───────────┼─────────┤\n",
"│ 1 │ A │ (60, 5) │\n",
"│ 2 │ B │ (40, 5) │"
]
},
"execution_count": 36,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"combine(size, groupby(data, :Treatment))"
]
},
{
"cell_type": "code",
"execution_count": 37,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<p><b>GroupedDataFrame with 2 groups based on key: Treatment</b></p><p><i>First Group (60 rows): Treatment = \"A\"</i></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>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>63</td><td>11.8</td><td>70</td><td>A</td><td>Worse</td></tr><tr><th>7</th><td>41</td><td>13.2</td><td>70</td><td>A</td><td>Worse</td></tr><tr><th>8</th><td>36</td><td>13.7</td><td>50</td><td>A</td><td>Improved</td></tr><tr><th>9</th><td>62</td><td>9.5</td><td>40</td><td>A</td><td>Static</td></tr><tr><th>10</th><td>34</td><td>13.6</td><td>30</td><td>A</td><td>Static</td></tr><tr><th>11</th><td>70</td><td>14.2</td><td>90</td><td>A</td><td>Static</td></tr><tr><th>12</th><td>54</td><td>12.9</td><td>30</td><td>A</td><td>Improved</td></tr><tr><th>13</th><td>78</td><td>11.0</td><td>30</td><td>A</td><td>Improved</td></tr><tr><th>14</th><td>53</td><td>15.5</td><td>100</td><td>A</td><td>Static</td></tr><tr><th>15</th><td>66</td><td>11.4</td><td>70</td><td>A</td><td>Worse</td></tr><tr><th>16</th><td>20</td><td>11.7</td><td>40</td><td>A</td><td>Worse</td></tr><tr><th>17</th><td>38</td><td>14.8</td><td>60</td><td>A</td><td>Improved</td></tr><tr><th>18</th><td>43</td><td>14.5</td><td>80</td><td>A</td><td>Static</td></tr><tr><th>19</th><td>26</td><td>7.9</td><td>10</td><td>A</td><td>Improved</td></tr><tr><th>20</th><td>63</td><td>9.5</td><td>50</td><td>A</td><td>Improved</td></tr><tr><th>21</th><td>48</td><td>12.4</td><td>30</td><td>A</td><td>Improved</td></tr><tr><th>22</th><td>46</td><td>11.1</td><td>100</td><td>A</td><td>Static</td></tr><tr><th>23</th><td>58</td><td>10.0</td><td>20</td><td>A</td><td>Worse</td></tr><tr><th>24</th><td>56</td><td>11.7</td><td>30</td><td>A</td><td>Improved</td></tr><tr><th>25</th><td>64</td><td>10.8</td><td>40</td><td>A</td><td>Worse</td></tr><tr><th>26</th><td>41</td><td>12.3</td><td>60</td><td>A</td><td>Worse</td></tr><tr><th>27</th><td>32</td><td>15.4</td><td>20</td><td>A</td><td>Improved</td></tr><tr><th>28</th><td>29</td><td>11.7</td><td>20</td><td>A</td><td>Improved</td></tr><tr><th>29</th><td>49</td><td>11.8</td><td>80</td><td>A</td><td>Improved</td></tr><tr><th>30</th><td>74</td><td>13.3</td><td>60</td><td>A</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><p>&vellip;</p><p><i>Last Group (40 rows): Treatment = \"B\"</i></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>1</th><td>59</td><td>11.9</td><td>30</td><td>B</td><td>Static</td></tr><tr><th>2</th><td>31</td><td>10.6</td><td>10</td><td>B</td><td>Static</td></tr><tr><th>3</th><td>45</td><td>13.6</td><td>90</td><td>B</td><td>Worse</td></tr><tr><th>4</th><td>78</td><td>11.8</td><td>70</td><td>B</td><td>Improved</td></tr><tr><th>5</th><td>18</td><td>12.3</td><td>20</td><td>B</td><td>Worse</td></tr><tr><th>6</th><td>53</td><td>12.7</td><td>60</td><td>B</td><td>Worse</td></tr><tr><th>7</th><td>80</td><td>12.1</td><td>20</td><td>B</td><td>Static</td></tr><tr><th>8</th><td>46</td><td>10.3</td><td>70</td><td>B</td><td>Improved</td></tr><tr><th>9</th><td>58</td><td>10.9</td><td>20</td><td>B</td><td>Improved</td></tr><tr><th>10</th><td>68</td><td>12.2</td><td>20</td><td>B</td><td>Improved</td></tr><tr><th>11</th><td>58</td><td>8.3</td><td>20</td><td>B</td><td>Worse</td></tr><tr><th>12</th><td>76</td><td>12.
],
"text/latex": [
"GroupedDataFrame with 2 groups based on key: Treatment\n",
"\n",
"First Group (60 rows): Treatment = \"A\"\n",
"\n",
"\\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 & 63 & 11.8 & 70 & A & Worse \\\\\n",
"\t7 & 41 & 13.2 & 70 & A & Worse \\\\\n",
"\t8 & 36 & 13.7 & 50 & A & Improved \\\\\n",
"\t9 & 62 & 9.5 & 40 & A & Static \\\\\n",
"\t10 & 34 & 13.6 & 30 & A & Static \\\\\n",
"\t11 & 70 & 14.2 & 90 & A & Static \\\\\n",
"\t12 & 54 & 12.9 & 30 & A & Improved \\\\\n",
"\t13 & 78 & 11.0 & 30 & A & Improved \\\\\n",
"\t14 & 53 & 15.5 & 100 & A & Static \\\\\n",
"\t15 & 66 & 11.4 & 70 & A & Worse \\\\\n",
"\t16 & 20 & 11.7 & 40 & A & Worse \\\\\n",
"\t17 & 38 & 14.8 & 60 & A & Improved \\\\\n",
"\t18 & 43 & 14.5 & 80 & A & Static \\\\\n",
"\t19 & 26 & 7.9 & 10 & A & Improved \\\\\n",
"\t20 & 63 & 9.5 & 50 & A & Improved \\\\\n",
"\t21 & 48 & 12.4 & 30 & A & Improved \\\\\n",
"\t22 & 46 & 11.1 & 100 & A & Static \\\\\n",
"\t23 & 58 & 10.0 & 20 & A & Worse \\\\\n",
"\t24 & 56 & 11.7 & 30 & A & Improved \\\\\n",
"\t25 & 64 & 10.8 & 40 & A & Worse \\\\\n",
"\t26 & 41 & 12.3 & 60 & A & Worse \\\\\n",
"\t27 & 32 & 15.4 & 20 & A & Improved \\\\\n",
"\t28 & 29 & 11.7 & 20 & A & Improved \\\\\n",
"\t29 & 49 & 11.8 & 80 & A & Improved \\\\\n",
"\t30 & 74 & 13.3 & 60 & A & Static \\\\\n",
"\t$\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ \\\\\n",
"\\end{tabular}\n",
"\n",
"$\\dots$\n",
"\n",
"Last Group (40 rows): Treatment = \"B\"\n",
"\n",
"\\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 & 59 & 11.9 & 30 & B & Static \\\\\n",
"\t2 & 31 & 10.6 & 10 & B & Static \\\\\n",
"\t3 & 45 & 13.6 & 90 & B & Worse \\\\\n",
"\t4 & 78 & 11.8 & 70 & B & Improved \\\\\n",
"\t5 & 18 & 12.3 & 20 & B & Worse \\\\\n",
"\t6 & 53 & 12.7 & 60 & B & Worse \\\\\n",
"\t7 & 80 & 12.1 & 20 & B & Static \\\\\n",
"\t8 & 46 & 10.3 & 70 & B & Improved \\\\\n",
"\t9 & 58 & 10.9 & 20 & B & Improved \\\\\n",
"\t10 & 68 & 12.2 & 20 & B & Improved \\\\\n",
"\t11 & 58 & 8.3 & 20 & B & Worse \\\\\n",
"\t12 & 76 & 12.4 & 30 & B & Improved \\\\\n",
"\t13 & 23 & 4.9 & 40 & B & Static \\\\\n",
"\t14 & 80 & 13.7 & 80 & B & Static \\\\\n",
"\t15 & 65 & 12.4 & 10 & B & Improved \\\\\n",
"\t16 & 22 & 14.7 & 10 & B & Improved \\\\\n",
"\t17 & 52 & 11.5 & 10 & B & Improved \\\\\n",
"\t18 & 60 & 9.5 & 120 & B & Worse \\\\\n",
"\t19 & 37 & 11.1 & 80 & B & Improved \\\\\n",
"\t20 & 45 & 14.0 & 80 & B & Improved \\\\\n",
"\t21 & 69 & 10.6 & 50 & B & Static \\\\\n",
"\t22 & 56 & 9.5 & 50 & B & Improved \\\\\n",
"\t23 & 59 & 14.2 & 30 & B & Worse \\\\\n",
"\t24 & 65 & 14.5 & 70 & B & Worse \\\\\n",
"\t25 & 57 & 13.6 & 20 & B & Static \\\\\n",
"\t26 & 40 & 12.5 & 40 & B & Improved \\\\\n",
"\t27 & 63 & 9.7 & 30 & B & Static \\\\\n",
"\t28 & 18 & 10.0 & 70 & B & Worse \\\\\n",
"\t29 & 30 & 14.2 & 50 & B & Improved \\\\\n",
"\t30 & 44 & 9.7 & 70 & B & Static \\\\\n",
"\t$\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ & $\\dots$ \\\\\n",
"\\end{tabular}\n"
],
"text/plain": [
"GroupedDataFrame with 2 groups based on key: Treatment\n",
"First Group (60 rows): Treatment = \"A\"\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 │ 63 │ 11.8 │ 70 │ A │ Worse │\n",
"│ 7 │ 41 │ 13.2 │ 70 │ A │ Worse │\n",
"│ 8 │ 36 │ 13.7 │ 50 │ A │ Improved │\n",
"│ 9 │ 62 │ 9.5 │ 40 │ A │ Static │\n",
"│ 10 │ 34 │ 13.6 │ 30 │ A │ Static │\n",
"⋮\n",
"│ 50 │ 24 │ 13.4 │ 40 │ A │ Static │\n",
"│ 51 │ 39 │ 11.0 │ 30 │ A │ Static │\n",
"│ 52 │ 45 │ 13.5 │ 20 │ A │ Worse │\n",
"│ 53 │ 43 │ 12.5 │ 10 │ A │ Improved │\n",
"│ 54 │ 51 │ 14.1 │ 50 │ A │ Worse │\n",
"│ 55 │ 52 │ 13.7 │ 70 │ A │ Worse │\n",
"│ 56 │ 33 │ 11.2 │ 20 │ A │ Improved │\n",
"│ 57 │ 30 │ 12.5 │ 110 │ A │ Worse │\n",
"│ 58 │ 60 │ 12.6 │ 30 │ A │ Static │\n",
"│ 59 │ 76 │ 7.1 │ 10 │ A │ Static │\n",
"│ 60 │ 36 │ 11.8 │ 10 │ A │ Worse │\n",
"⋮\n",
"Last Group (40 rows): Treatment = \"B\"\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 │ 59 │ 11.9 │ 30 │ B │ Static │\n",
"│ 2 │ 31 │ 10.6 │ 10 │ B │ Static │\n",
"│ 3 │ 45 │ 13.6 │ 90 │ B │ Worse │\n",
"│ 4 │ 78 │ 11.8 │ 70 │ B │ Improved │\n",
"│ 5 │ 18 │ 12.3 │ 20 │ B │ Worse │\n",
"│ 6 │ 53 │ 12.7 │ 60 │ B │ Worse │\n",
"│ 7 │ 80 │ 12.1 │ 20 │ B │ Static │\n",
"│ 8 │ 46 │ 10.3 │ 70 │ B │ Improved │\n",
"│ 9 │ 58 │ 10.9 │ 20 │ B │ Improved │\n",
"│ 10 │ 68 │ 12.2 │ 20 │ B │ Improved │\n",
"⋮\n",
"│ 30 │ 44 │ 9.7 │ 70 │ B │ Static │\n",
"│ 31 │ 29 │ 11.7 │ 80 │ B │ Worse │\n",
"│ 32 │ 33 │ 12.9 │ 10 │ B │ Worse │\n",
"│ 33 │ 27 │ 11.9 │ 20 │ B │ Improved │\n",
"│ 34 │ 19 │ 13.1 │ 100 │ B │ Worse │\n",
"│ 35 │ 49 │ 14.9 │ 40 │ B │ Worse │\n",
"│ 36 │ 47 │ 13.2 │ 40 │ B │ Worse │\n",
"│ 37 │ 38 │ 12.0 │ 210 │ B │ Worse │\n",
"│ 38 │ 35 │ 10.2 │ 40 │ B │ Static │\n",
"│ 39 │ 25 │ 13.0 │ 20 │ B │ Static │\n",
"│ 40 │ 54 │ 16.1 │ 50 │ B │ Improved │"
]
},
"execution_count": 37,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"groupby(data, :Treatment)"
]
},
{
"cell_type": "code",
"execution_count": 38,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table class=\"data-frame\"><thead><tr><th></th><th>Treatment</th><th>x1</th></tr><tr><th></th><th>String</th><th>Float64</th></tr></thead><tbody><p>2 rows × 2 columns</p><tr><th>1</th><td>A</td><td>15.3961</td></tr><tr><th>2</th><td>B</td><td>18.1072</td></tr></tbody></table>"
],
"text/latex": [
"\\begin{tabular}{r|cc}\n",
"\t& Treatment & x1\\\\\n",
"\t\\hline\n",
"\t& String & Float64\\\\\n",
"\t\\hline\n",
"\t1 & A & 15.3961 \\\\\n",
"\t2 & B & 18.1072 \\\\\n",
"\\end{tabular}\n"
],
"text/plain": [
"2×2 DataFrame\n",
"│ Row │ Treatment │ x1 │\n",
"│ │ \u001b[90mString\u001b[39m │ \u001b[90mFloat64\u001b[39m │\n",
"├─────┼───────────┼─────────┤\n",
"│ 1 │ A │ 15.3961 │\n",
"│ 2 │ B │ 18.1072 │"
]
},
"execution_count": 38,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"combine(df -> std(df.Age), groupby(data, :Treatment))"
]
},
{
"cell_type": "code",
"execution_count": 41,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Summary Stats:\n",
"Length: 60\n",
"Missing Count: 0\n",
"Mean: 51.333333\n",
"Minimum: 20.000000\n",
"1st Quartile: 39.000000\n",
"Median: 51.000000\n",
"3rd Quartile: 63.000000\n",
"Maximum: 80.000000\n",
"Type: Int64\n",
"Summary Stats:\n",
"Length: 40\n",
"Missing Count: 0\n",
"Mean: 47.775000\n",
"Minimum: 18.000000\n",
"1st Quartile: 32.500000\n",
"Median: 48.000000\n",
"3rd Quartile: 59.250000\n",
"Maximum: 80.000000\n",
"Type: Int64\n"
]
},
{
"data": {
"text/html": [
"<table class=\"data-frame\"><thead><tr><th></th><th>Treatment</th><th>x1</th></tr><tr><th></th><th>String</th><th>Nothing</th></tr></thead><tbody><p>2 rows × 2 columns</p><tr><th>1</th><td>A</td><td></td></tr><tr><th>2</th><td>B</td><td></td></tr></tbody></table>"
],
"text/latex": [
"\\begin{tabular}{r|cc}\n",
"\t& Treatment & x1\\\\\n",
"\t\\hline\n",
"\t& String & Nothing\\\\\n",
"\t\\hline\n",
"\t1 & A & \\\\\n",
"\t2 & B & \\\\\n",
"\\end{tabular}\n"
],
"text/plain": [
"2×2 DataFrame\n",
"│ Row │ Treatment │ x1 │\n",
"│ │ \u001b[90mString\u001b[39m │ \u001b[90mNothing\u001b[39m │\n",
"├─────┼───────────┼─────────┤\n",
"│ 1 │ A │ │\n",
"│ 2 │ B │ │"
]
},
"execution_count": 41,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"combine(df -> describe(df.Age), groupby(data, :Treatment))"
]
},
{
"cell_type": "code",
"execution_count": 42,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"┌ Info: Precompiling StatsPlots [f3b207a7-027a-5e70-b257-86293d7955fd]\n",
"└ @ Base loading.jl:1242\n"
]
}
],
"source": [
"using StatsPlots"
]
},
{
"cell_type": "code",
"execution_count": 43,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAlgAAAGQCAYAAAByNR6YAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAPYQAAD2EBqD+naQAAADh0RVh0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zZ4/K/FBGCxbHcezvv/8uld+5c+cYAObp6cnS0tJKlqelpTEPDw8GQKnFrqItWMV1tyAIJcvPnDnDOI5jbm5uTKFQaHQcyP+hpwhJpTk4OAAAUlJS1FrfyMio1LKKDIavX78+5s2bp3G60aNHo3nz5iV/i8ViLF26FADw22+/aZxfZSQkJODUqVNo1qxZqVanDz74AJ6enjh58iQSEhJKpV22bBnMzMxK/m7atCm6du2Ke/fuKf0KLsuWLVsAAN9++61Sy5+joyNmzpyJwsJCbN++vYJ7VsTc3BxWVlallvfs2RPNmzfHP//8o7R827ZtMDQ0VGq5BIpaSfz9/Uvls3XrVmRkZGDZsmVwcnJS+mzkyJFo06YNQkNDS6VTdQ1aW1urtU/FvvrqK0gkkpK/PTw8MG7cOKSlpSk9BDBp0iQwxhASEqKUfuPGjQCgVmujulq3bo1x48aVWl6R4/Rqq1Exe3t7DB06FA8ePEBcXJzG5Zs7dy5sbW1L/u7YsSMaN26MtLQ0fP311zA2Ni75bOjQoZBIJLh9+3bJspSUFOzatQu9evXC2LFjlfKuV68ePvvsMyQnJ5e6roDK3y/liYuLw4ULF9C6dWu88847Sp99/vnnKu+BYoMGDULv3r1LLS++PxctWqT0YIy5uXnJ/VG8TmWIRKJSDyn5+voiMDAQMTExuHT
},
"execution_count": 43,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"@df data density(:Age, group = :Treatment, title = \"Distribution of ages by treatment group\",\n",
" xlab = \"Age\", ylab = \"Distribution\",\n",
" legend = :topright\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 44,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAlgAAAGQCAYAAAByNR6YAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAPYQAAD2EBqD+naQAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAgAElEQVR4nOzdd1gU1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oT4+PgsNwGMHDkSIQSLFi3Ksv78+fMB8tTa+LTZs2dniz86Opq//vqLVq1aMXjw4CzvVahQgbFjxxIVFZXteOd0HMqVK5enluDisGLFCnQ6HR9//HGW81O2bNkXXvtTp07N9tlLT09nxYoV2NnZZVu/Xbt2tGvXjqtXr3Lo0KGXjr1Nmza0atUqy7IZM2ZgYmJS7N8z0ovJLkKpRBJ5nEqhc+fOfPbZZ3zwwQfs3LmT9u3bExAQQPXq1QtUb/369Qv0Q9C8efNsy/z8/LCwsODMmTMFiqWgTp8+DUBgYGC2rklFUWjRogWXLl3i7NmzuLq6Znnfx8cn2/ZcXFwAiI+Pp1y5ci+sO3Ps0LMyu24K43iEhITwww8/cPToUaKjo9FqtYb3nj5/iYmJhIeHU7t2bRwcHLJtp1mzZuzYsSPLsiNHjhj+e+3atWzrpKamEh0dTXR0NPb29vTp04d169bRuHFj3nzzTYKDg2nevDmOjo752icTExOaNGmSbXnz5s355ZdfOHPmjOHO244dO+Li4sLixYuZMmUKKpWK1NRUli9
},
"execution_count": 44,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"@df data density(:Age, group = :Result, title = \"Distribution of ages by result group\",\n",
" xlab = \"Age\", ylab = \"Distribution\",\n",
" legend = :topright\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 47,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAlgAAAGQCAYAAAByNR6YAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAPYQAAD2EBqD+naQAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAgAElEQVR4nOzdd1gUV9vA4d/SmxRBFETBClIEUVEURLCg2CtRY0eTqDFdY2I0eU2iMTHRGH1tqLHEEjUq1ljA3pWoFEsExYpAQJAO8/3ht/u67lIFFs25r4tL98yZmWfKzj475+wZmSRJEoIgCIIgCEKF0d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+//SYB0qRJkxRl/fv3lwDpr7/+UokpKSmpVNtkb28vAVJAQICUm5urKI+JiZEMDQ0lc3Nz6cmTJ4ryHj16SDKZTIqLi1NazqVLlyRACg4OLvV6izq3nt8/oaGhKtPLup8kSVI59pIkSffv35dsbW2lJk2aqF2/uveKJEnSyJEjJUBq0qSJlJiYqCg/ffq0BEjm5uaSj4+PlJGRoZi2adMmCZAmT56stKyhQ4dKgLRy5Uql8ocPH0r16tWTatWqJWVlZSnKy/p+kV8nwsPD1W5LUeLj46X8/HylssLCQmnMmDESIB0/flxpmvw86tOnj9L77+DBg2qvu/J9+PXXXyuVy68TpY25pOtnbm6u5ODgINWoUUOKjIxUmnbs2DFJW1tb6tmzp6Lsww8/lABpx44dKst68T1V3PWjuGv289tV1HW0JCtWrJAAqXfv3lJBQYG
},
"execution_count": 47,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"@df data density(:Age, group = (:Treatment,:Result), title = \"Distribution of ages by treatment and result groups\",\n",
" xlab = \"Age\", ylab = \"Distribution\",\n",
" legend = :topright\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 49,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAlgAAAGQCAYAAAByNR6YAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAPYQAAD2EBqD+naQAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAgAElEQVR4nO3deVxWZf7/8fetIJuCC5q4ALmjkgqugVuZEmkqqLlNappWOjbZZDWTa1aTmWOmNYt7mWlBY6ml1eCaNiqZueaSIWpuuCWKitfvD3/cX2+5QZEDN8vr+Xj4kHOdc5/zubfDm3Nd5xybMcYIAAAAlinh6gIAAACKGgIWAACAxQhYAAAAFiNgocCz2Wxq167dHS8/cOBA2Ww2HTp0KM9qcgVnz+vQoUOy2WwaOHCgy+oq6Irq5wFAwU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wy6fPmyRo8ererVq8vT01OhoaFOX0u4lpurC0DRk7HDS0hI0AsvvGBvT0hIUJkyZdS8eXNFREQoISHB4XEZ0866B8+ePWvfOffr108nTpzQ4sWL1alTJ23dulUNGzbMsp527drp0KFDmj9/vtq2beuw0ypbtqwkKS0tTVFRUVq9erWaNGmiwYMH6+rVq1q+fLm6du2qd999VyNGjLjtczfGqE+fPlq8eLGqVq2qPn36yNfXV4cOHdLixYsVFRWlwMBASVJKSoratGmjnTt3qnXr1urUqZPOnTunpUuXqn379vrkk0/UrVu3224zJy5fvqxOnTpp7dq1ql27tgYNGiQPDw/t27dP//jHP/T444+rXLlykm78oujYsaPS0tLUo0cPBQcHa9OmTZo2bZqWL1+ujRs3qkKFCrmu6YUXXtDq1avVuXNndezYUf/5z380fvx4XblyRa+99pokqVu3bjp79qyWLl2qrl27qnHjxjnezp/+9Cdt2rRJvXr1kqenp+Lj4zV69Gjt379f//znPyXd+OzVqVNHCxcu1JQpU+Tl5eWwjlmzZkmSnnzyydtua968efrxxx/17LPP2j9nt4bM06dPq1WrVipfvrwee+wxXblyRb6+vpKkAwcO2ANYx44d1a1bN504cUJxcXFauXKlvv32W7Vo0cK+rjfffFP79+9Xy5Yt1b17d509e1ZfffWVhg0bpr179+rtt9+21zBu3DhNmDBBQUFBDr/gb31dP/vsM61atUrdunVTRESEli9frkmTJskYo3LlymnixInq2rWr2rRpo7i4OL3wwgsKCAhQv3797Oswxqh///766KOPVKdOHfXt21elSpXS119/rcGDB2vXrl1Og9nMmTP15ZdfqmvXrmrXrp2++uorvfvuuzp9+rQWLlwo6c6+21n5/fff1bZtW+3atUuRkZGKjIzUkSNH1KdPH3Xs2DHLx2W8xg0aNNCAAQOUkpKiUqVKSZLi4uLUu3dvlSpVyv6HyTfffKMJEyZo1apVSkhIkIeHR7Z13YmePXtq+/bt6tmzp65evaolS5Zo8ODBOn78uF5++eVcrx8WMYDFrl27ZsqUKWPKlCljrl69am+vXbu2iYqKMsYY8/rrrxubzWZOnjxpn9++fXsjySQmJjqsT5KRZJ555hmTnp5ub581a5aRZIYNG+aw/IABA4wk88svv9jbEhISjCQzbtw4pzX/5S9/MZLM+PHjzfXr1+3t58+fN02bNjWlSpUyR44cue1znzlzppFkHnzwQZOamuowLzU11Zw+fdo+3bdvXyPJzJkzx2G53377zVSvXt1UrFjRXLp0Kdvn9csvvxhJZsCAAbetzRhjXnjhBSPJ/OEPfzDXrl1zmHf27Flz4cIFY4wx6enppnbt2kaS+eqrrxyWe/nll40kM3jwYId2SaZt27ZOtxsUFGSCgoIc2jKez7333muOHj1qbz958qQpW7asKVOmjElLS7O3z50710gyc+fOvaPneut27rnnHof38MKFCyY0NNRIMmvXrrW3v/XWW0aSmT9/vsN60tLSjL+/v6latWqm1y677d78ft0s43M9aNAgp+u7//77jZubm1m1apVD+969e02ZMmVMaGioQ/vBgwczrePq1avmoYceMiVLljS//vprpu1n9X5lvNbu7u7mf//7n739/PnzplKlSsbb29tUrlzZHDhwwD4vKSnJlCpVytx3330O6/rXv/5l/7zcvD9IS0szXbp0MZLMli1b7O3jxo0zkoyfn5/Zs2ePvT01NdXUqVPH2Gw2h/fxdt/trLzyyitGkhk+fLhDe8b6bv2sZXzXJJkxY8ZkWt/58+dN2bJljYeHh/nxxx/t7devX7d/11999dVM68vqu+vs/Wnbtq2RZOrXr2/Onz9vbz927JgJCAgwbm5uDu8JXIuAhTwRHR1tJJlNmzYZY4w5cuSIkWTeeOMNY4wxGzZsMJLMp59+aoy5sbP18vIy5cqVcwhRxtzY0fj4+Nh/+We4evWqcXNzM2FhYQ7tOQ1Y6enpply5cqZWrVoO4SrD559/biSZd99997bPu379+qZkyZLm559/zna5kydPmpIlS5oHH3zQ6fzp06cbSeaLL77I9nnlJGBdu3bN+Pr6Gj8/P5OSkpLtsmvXrjWSzMMPP5xp3u+//24qVKhgvLy8HALQ3QasWwPmzfO2b99ub8ttwHrttdcyzfvkk08yhcWTJ08aDw8P07p1a4dllyxZYiSZV155JUfbzS5glSpVyuGPjAyJiYlOQ2yGUaNGGUnmp59+um0dcXFxRpKZN29epu3fLmANHDgw07wnnnjCSDITJkzINO+BBx4wJUuWdAhS9913n/Hx8XH4YyHD9u3bjSTz/PPP29syAtbYsWMzLZ8x7/PPP7e33W3ACg4ONh4eHubEiROZ5nXq1CnLgFW5cmWHz32GBQsWGEnm6aefzjQvKSnJuLm5mZo1a2Za390ErIULF2ZaPuMPg5tDHFyLLkLkifbt22vFihVKSEh
},
"execution_count": 49,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"@df data boxplot(:Treatment,:WCC, lab = \"WCC\", title = \"White cell count by treatment group\",\n",
" xlab = \"Groups\", ylab = \"WCC\"\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 50,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAlgAAAGQCAYAAAByNR6YAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAPYQAAD2EBqD+naQAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAgAElEQVR4nOzdeVxVdR7/8fdVCAEFF1xwAXJHRRF3QQXTJNIs0DYtNbcWo6xspmkRrZxSc9LRmvn93MvMSmasdLKawB1HJTUVzdwQxURBY9zB7+8Pf9zxBiLqgQv4ej4ePuQs95zPufcAb77f7/1emzHGCAAAAJap4OwCAAAAyhsCFgAAgMUIWAAAABYjYOG2ZLPZFB4eXuT9hw4dKpvNpoMHDxZbTc5Q0HUdPHhQNptNQ4cOdVpdpV15vR+sdKPfY0B5Q8BCqbd27VrZbDb169evwO2jR4+WzWZT27ZtC9z+5ptvymazafLkyZbWlZiYKJvNpri4OEuPi5Izf/582Ww2zZ8/39ml3BYIpridELBQ6nXq1Emenp5avXq1cnNz823PCzrbtm1TZmZmgdslKSIi4qZr+POf/6yUlBTVq1fvpo8BALh9ELBQ6rm6uio0NFS//fabkpOTHbalp6fr559/1gMPPCBjjFatWuWw/eLFi9qwYYO8vLwUEhJy0zX4+vqqefPmcnV1veljAABuHwQslAl5rU95rVF58pZffPFFVa5cOd/2jRs36ty5c+revbsqVqyY77gZGRl64oknVKtWLbm7u6tz5875jiHl79qIi4uz1zRhwgTZbDb7v6u7Py5evKhp06YpJCREnp6eqlKlirp166Yvv/zyhq7fGKMFCxaoe/fuqlq1qjw8PNSkSRM9+eSTSk1Nddg3Oztb48ePV8uWLeXu7q6qVasqMjJSa9euvaFz3oiLFy9q+vTp6tixo6pUqaLKlSurRYsWeuGFF5SVleWw786dO/XQQw+pVq1acnNz05133qmxY8cW2PpY2DiegIAABQQEOKy7+nX64IMPFBgYqEqVKsnf318TJkzQ5cuXHfYdNmyYJGnYsGEOr2FR5ebm6s9//rMaN26sSpUqqUmTJpoyZYrDeRISEmSz2fTMM88UeIxdu3bJZrOpf//+1z1f3vXt379ff/nLX9SyZUu5ubk5jJczxmju3LkKDQ2Vl5eXPDw81L59e82dOzff8c6fP6/33ntPbdq0kbe3typXrqxGjRrpkUce0U8//WTfLy4uTjabrcDvjaJ2swYEBGjBggWSpDvvvNP+XBd1nNaqVavUvXt3eXp6qkaNGnrooYd0+PBhhYeH53vNrq53wYIFateunTw8PBzOlZOTo7/85S9q06aN3N3d5e3trYiICC1fvjzfuW/0+q8ex7hjxw7dc8898vb2lpeXl/r166ddu3YV6ZpRtrk4uwCgKPLCTEJCgsaNG2dfn5CQoCpVqqhjx44KDQ1VQkKCw+PylgvqHjx16pT9l9CgQYN0/PhxLVmyRH369NGWLVvUqlWra9YTHh6ugwcPasGCBerRo4fDD+6qVatKki5cuKDIyEglJiaqbdu2Gj58uC5duqTly5erf//++utf/6oxY8Zc99qNMXrkkUe0ZMkS1atXT4888oi8vLx08OBBLVmyRJGRkfLz85MkZWZmqnv37tq5c6e6deumPn366PTp01q2bJkiIiL0+eef6/7777/uOW/E+fPn1adPH61evVpNmjTRsGHD5Obmpr179+pvf/ubHn/8cVWrVk2StH79et199926cOGCBgwYoICAACUlJen999/X8uXLtWHDBtWoUeOWaxo3bpwSExPVt29f3X333frnP/+puLg4Xbx4UW+//bYk6f7779epU6e0bNky9e/fX8HBwTd8nueff15JSUl68MEHValSJcXHx+vll1/WL7/8or///e+Srtx7TZs21aJFizR16lS5u7s7HGP27NmSpJEjRxb5vM8++6ySkpJ07733qm/fvqpdu7akK/fK4MGD9cknn6hp06Z69NFHdccdd+i7777T8OHDtWvXLk2dOtV+nCFDhuizzz5T69at7a9bamqqEhIS1KdPHwUFBd3wc3Itzz//vObPn69t27bpueees3+f/D4kF+Tbb7/VvffeKxcXFz300EPy9fVVYmKiwsLC7PdWQaZMmaKEhATdd9996t27t1xcrvzKM8booYceUnx8vJo2bapnnnlGZ86c0Weffaa+fftq+vTpio2NveVr3r9/v0JDQ9WxY0c9/fTT2rt3r/7xj39o7dq1Wr9+vQIDA2/5HCjFDFAG5OTkmCpVqpgqVaqYS5cu2dc3adLEREZGGmOMmTRpkrHZbCYjI8O+PSIiwkgyycnJDseTZCSZp59+2uTm5trXz54920gyo0ePdth/yJAhRpI5cOCAfV1CQoKRZMaPH19gzX/605+MJBMXF2cuX75sX//bb7+Z9u3bmzvuuMMcOXLkutc+a9YsI8ncdddd5uzZsw7bzp49a06ePGlffvTRR40kM3fuXIf9jh07Zho0aGBq1qxpzp07V+h1HThwwEgyQ4YMuW5txhgzbtw4I8k89thjJicnx2HbqVOnTHZ2tjHGmNzcXNOkSRMjyXzzzTcO+73yyitGkhk+fLjDekmmR48eBZ7X39/f+Pv7O6zLu54777zTHD161L4+IyPDVK1a1VSpUsVcuHDBvn7evHlGkpk3b16RrvX356ldu7bDa5idnW2CgoKMJLN69Wr7+ilTphhJZsGCBQ7HuXDhgvHx8TH16tXL99wVdt769eubQ4cO5dv+f/7P/7E/j1d/n1y4cMH069fPSDKbN282xlx5bWw2m2nfvn2+c+fk5JisrCz78vjx440kk5CQkO+c13oOC3rtCrrfricnJ8f4+/ubChUqmKSkJIdtQ4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s23btk2S1LVr13zb6tevLz8/Px04cKDAxxb0PElX7kV
},
"execution_count": 50,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"@df data boxplot(:Result,:WCC, lab = \"WCC\", title = \"White cell count by result group\",\n",
" xlab = \"Groups\", ylab = \"WCC\"\n",
")"
]
},
{
"cell_type": "code",
"execution_count": 51,
"metadata": {},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAlgAAAGQCAYAAAByNR6YAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAPYQAAD2EBqD+naQAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAgAElEQVR4nOzde3RU9bk//vfeM5MZEi4BQ4AIwwASEUGTUBBDSrVipZG6egSpOaBE4UCPWI5tz+G0HjztalHbtai/eqnVnhbESqco0MJC7KK2IkVRgZSqXzGiCCE6EJJyDZkwM/vz+2PPTOZ+y57Zeybvl4sVZ8++PDMZkof9eT7PRxJCCBARERGRZmS9AyAiIiIqNEywiIiIiDTGBIuIiIhIY2a9AyCi9DidTjidzrBtDQ0NaGho0Cmi/CBJkt4hZKwvlcom+3zn8/dRS33pM5GvJBa5E1FfkM+/mPljukc+fx+1xM+E8fEOFmXE5XLB5XJpcq6ysjLY7XZNzkVERGQETLAobS6XCxUVFZqdz2azobm5mUkWEREVDMMVubvdbnz9619HZWUlqqqqMHv2bBw9ehQA0NbWhtmzZ2P8+PGYNGkS9uzZo2+wfZRWd64C3G432tvbNT0nERGRngyXYAHA0qVL0dzcjIMHD2LOnDlYunQpAOB73/sepk+fjsOHD2PdunVYsGABvF6vztESERERhTNcgmWz2VBfXx8sZJw+fTqOHDkCAHjxxRexfPlyAMDUqVMxbNgw3sUiIiIiwzF8DdYTTzyBr33ta+jo6ICiKBg6dGjwOYfDgZaWFh2jyx9aFqUfOnRIk/MQEREVKkMnWI888ggOHz6MZ555Bl1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vbmWAREVFaNKnBevbZZzF06FB88YtfxGWXXYYJEybgsssuw8yZMzFs2DA8++yz6sVkGf/93/+d9vnLy8tRXV2NF154AQCwefNmOBwODg8SERGRIWnaaHTHjh3Yv38/XC4XRowYgalTp+KrX/0qPv74Y1xxxRUpnWP58uXYunUrTpw4gbKyMvTv3x8ff/wxmpub0djYiI6ODgwcOBDr16/H1VdfrVXohsNGo8bBpqXh2OiRUsVGo4WLjUaTy1on97a2Nvz+97/Hhg0bsH//fvh8vmxcxlBcLhdcLpcm5zp06JBmdUTUO0ywwvEXHKWKCVbhYoKVnCY1WAEXLlzAli1bsGHDBvz1r3+Foij4whe+gCeffFLLyxiSy+VCRUWF3mEQERGRAfQ6wfJ6vdixYwc2bNiA7du3w+124/LLL4eiKHjxxRcxd+5cLeI0PK3uXBEREVH+yzjB2r17NzZs2IBNmzbh9OnTKCsrwz333IMFCxbgqquuwpAhQzB06FAtYyUiIiLKCxknWDfccAMkScJNN92E73znO7j55pthMpkAqL2viIiIiPqqjBOsqqoqHDx4ELt27YIsy2hra8O//Mu/RHVzJyJtpdJEl4XAlK/YJJqSMcrPt2SF/r2aRdjc3IwXXngBTqcTR44cgc1mw5w5czBnzhzcc889eO211zBz5sxMT59X2FahcOXjLEKj/AAi48u32WD8bBuDnp8bo3wGkr0HvWo0euWVV+LHP/4xPv74Y7z55ptYvHgxdu/ejcbGRgDqGoW7d+/uzSWIiIiI8o4mndwBYPr06XjyySfx+eefY8eOHViwYAH+/Oc/48Ybb8TYsWO1ugwRERGR4WnaBwtQl8OZPXs2Zs+eja6uLmzduhW/+93vtL4MERERkWFpdgcrln79+uHOO+/Etm3bsnkZIiIiIkPJaoJFRERE1BcxwSIiIiLSGBMsIiIiIo0xwSIiIiLSGBMsIiIiIo0xwSIiIiLSGBM
},
"execution_count": 51,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"@df data corrplot([:Age :WCC :CRP], grid = false)"
]
},
{
"cell_type": "code",
"execution_count": 53,
"metadata": {},
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blg1TE9Po1gsYvHixQCAO++8EytXruzyqJrQydydwJLRuE52FwUEl61qBCBKNvZ6lpyDniVKuLvO3/9QODGrpnUKpoqMeQ4bQGZ0wNjoMlnVMltUsAf9vPAaq5LvuIhMsG92aa/RXYx92WeSiGgw9ESAdfXVV+Oee+7BCy+8gEsuuQTj4+O4//77sW7dOnieB6UUTj31VHzpS1/q9lCbEJW7U0+DuTtRyfMA9IzVkKkXlan/YR4X7NSVJOgoDzaUt5Uz4/Q/XqKqYKqS+nYo6IDR1Q8r7x40uwWTBlcxGw5ymRn9MuENByJjZtoaOU8Zym9rcZMDdzESEfWNngiwNm/ejM2bN1fd/vOf/7wLo0lZs7NCSiYraVWvpALm9ExWouT5qGCn3usrQEjU3dHnX6pUBQALTJJ6xhQR9S9N+vLGlGf+7ptZEi6AI9D1u4ZNENNAUFrzmiF6w4EqQedVJb0+AoBTmYlstUBpKzOhRETUcT0RYA20ZmeFkhTHTHvJKDLYqTdOF3rKJ+6lS4istK6eB+QiM2uzMDSro3yPjarplUUlUCsCGNOzdEmC0qav2Zw51yTtecwOTeHqxykvhfeplZlQIiLqtJ6o5D7Y7KxQIxIWx2xmyajuSy9E0vHq1a2RGgcU9GuqAqrGqcysjdwNwDP5U+Z1hTAzVxHBlcihqhSCmjYzRUmC0iavmZ2JFEMmf20I1ddJmNvHzGPzOhdLHmjuNQM3tzATSkREHccZrHazs0INlApIVByzHcnzqgS9HDcM4BCq6zoFBomSt8jMeEW
},
"execution_count": 53,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"@df data cornerplot([:Age :WCC :CRP], grid = false, compact = true)"
]
},
{
"cell_type": "code",
"execution_count": 54,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"┌ Warning: `getindex(df::DataFrame, col_ind::ColumnIndex)` is deprecated, use `df[!, col_ind]` instead.\n",
"│ caller = top-level scope at In[54]:1\n",
"└ @ Core In[54]:1\n",
"┌ Warning: `getindex(df::DataFrame, col_ind::ColumnIndex)` is deprecated, use `df[!, col_ind]` instead.\n",
"│ caller = top-level scope at In[54]:1\n",
"└ @ Core In[54]:1\n"
]
},
2020-05-29 18:37:25 +00:00
{
"data": {
"text/plain": [
2020-05-30 02:09:04 +00:00
"Two sample t-test (equal variance)\n",
"----------------------------------\n",
"Population details:\n",
" parameter of interest: Mean difference\n",
" value under h_0: 0\n",
" point estimate: 3.558333333333337\n",
" 95% confidence interval: (-3.1369, 10.2536)\n",
"\n",
"Test summary:\n",
" outcome with 95% confidence: fail to reject h_0\n",
" two-sided p-value: 0.2942\n",
"\n",
"Details:\n",
" number of observations: [60,40]\n",
" t-statistic: 1.05468405102565\n",
" degrees of freedom: 98\n",
" empirical standard error: 3.373838193412482\n"
2020-05-29 18:37:25 +00:00
]
},
2020-05-30 02:09:04 +00:00
"execution_count": 54,
2020-05-29 18:37:25 +00:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
2020-05-30 02:09:04 +00:00
"HypothesisTests.EqualVarianceTTest(dataA[:Age],dataB[:Age])"
2020-05-29 18:37:25 +00:00
]
},
{
"cell_type": "code",
2020-05-30 02:09:04 +00:00
"execution_count": 55,
2020-05-29 18:37:25 +00:00
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
2020-05-30 02:09:04 +00:00
"┌ Warning: `getindex(df::DataFrame, col_ind::ColumnIndex)` is deprecated, use `df[!, col_ind]` instead.\n",
"│ caller = top-level scope at In[55]:1\n",
"└ @ Core In[55]:1\n",
"┌ Warning: `getindex(df::DataFrame, col_ind::ColumnIndex)` is deprecated, use `df[!, col_ind]` instead.\n",
"│ caller = top-level scope at In[55]:1\n",
"└ @ Core In[55]:1\n"
2020-05-29 18:37:25 +00:00
]
2020-05-30 02:09:04 +00:00
},
{
"data": {
"text/plain": [
"0.5646191047328868"
]
},
"execution_count": 55,
"metadata": {},
"output_type": "execute_result"
2020-05-29 18:37:25 +00:00
}
],
"source": [
2020-05-30 02:09:04 +00:00
"pvalue(EqualVarianceTTest(dataA[:WCC],dataB[:WCC]))"
2020-05-29 18:37:25 +00:00
]
},
{
"cell_type": "code",
2020-05-30 02:09:04 +00:00
"execution_count": 56,
2020-05-29 18:37:25 +00:00
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
2020-05-30 02:09:04 +00:00
"┌ Warning: `getindex(df::DataFrame, col_ind::ColumnIndex)` is deprecated, use `df[!, col_ind]` instead.\n",
"│ caller = top-level scope at In[56]:1\n",
"└ @ Core In[56]:1\n",
"┌ Warning: `getindex(df::DataFrame, col_ind::ColumnIndex)` is deprecated, use `df[!, col_ind]` instead.\n",
"│ caller = top-level scope at In[56]:1\n",
"└ @ Core In[56]:1\n"
2020-05-29 18:37:25 +00:00
]
},
{
"data": {
"text/plain": [
2020-05-30 02:09:04 +00:00
"Two sample t-test (unequal variance)\n",
"------------------------------------\n",
"Population details:\n",
" parameter of interest: Mean difference\n",
" value under h_0: 0\n",
" point estimate: -3.6666666666666643\n",
" 95% confidence interval: (-17.7595, 10.4261)\n",
"\n",
"Test summary:\n",
" outcome with 95% confidence: fail to reject h_0\n",
" two-sided p-value: 0.6052\n",
"\n",
"Details:\n",
" number of observations: [60,40]\n",
" t-statistic: -0.5195095536758766\n",
" degrees of freedom: 65.70999926955622\n",
" empirical standard error: 7.057938859300185\n"
2020-05-29 18:37:25 +00:00
]
},
2020-05-30 02:09:04 +00:00
"execution_count": 56,
2020-05-29 18:37:25 +00:00
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
2020-05-30 02:09:04 +00:00
"UnequalVarianceTTest(dataA[:CRP],dataB[:CRP])"
2020-05-29 18:37:25 +00:00
]
},
{
"cell_type": "code",
2020-05-30 02:09:04 +00:00
"execution_count": 57,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"StatsModels.TableRegressionModel{LinearModel{GLM.LmResp{Array{Float64,1}},GLM.DensePredChol{Float64,LinearAlgebra.Cholesky{Float64,Array{Float64,2}}}},Array{Float64,2}}\n",
"\n",
"CRP ~ 1\n",
"\n",
"Coefficients:\n",
"──────────────────────────────────────────────────────────────────────────\n",
" Estimate Std. Error t value Pr(>|t|) Lower 95% Upper 95%\n",
"──────────────────────────────────────────────────────────────────────────\n",
"(Intercept) 47.3 3.23446 14.6238 <1e-25 40.8821 53.7179\n",
"──────────────────────────────────────────────────────────────────────────"
]
},
"execution_count": 57,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"fit(LinearModel, @formula(CRP ~ 1), data)"
]
},
{
"cell_type": "code",
"execution_count": 58,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"StatsModels.TableRegressionModel{LinearModel{GLM.LmResp{Array{Float64,1}},GLM.DensePredChol{Float64,LinearAlgebra.Cholesky{Float64,Array{Float64,2}}}},Array{Float64,2}}\n",
"\n",
"CRP ~ 1 + Age\n",
"\n",
"Coefficients:\n",
"────────────────────────────────────────────────────────────────────────────────\n",
" Estimate Std. Error t value Pr(>|t|) Lower 95% Upper 95%\n",
"────────────────────────────────────────────────────────────────────────────────\n",
"(Intercept) 47.5107 10.3826 4.576 <1e-4 26.9068 68.1146 \n",
"Age -0.00422142 0.197566 -0.0213672 0.9830 -0.396284 0.387841\n",
"────────────────────────────────────────────────────────────────────────────────"
]
},
"execution_count": 58,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"fit(LinearModel, @formula(CRP ~ Age), data)"
]
},
{
"cell_type": "code",
"execution_count": 59,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"StatsModels.TableRegressionModel{LinearModel{GLM.LmResp{Array{Float64,1}},GLM.DensePredChol{Float64,LinearAlgebra.Cholesky{Float64,Array{Float64,2}}}},Array{Float64,2}}\n",
"\n",
"CRP ~ 1 + Age + WCC\n",
"\n",
"Coefficients:\n",
"────────────────────────────────────────────────────────────────────────────────\n",
" Estimate Std. Error t value Pr(>|t|) Lower 95% Upper 95%\n",
"────────────────────────────────────────────────────────────────────────────────\n",
"(Intercept) 24.0772 22.2914 1.08011 0.2828 -20.165 68.3193 \n",
"Age 0.00504769 0.197308 0.0255827 0.9796 -0.386555 0.39665\n",
"WCC 1.89764 1.59831 1.18728 0.2380 -1.27456 5.06984\n",
"────────────────────────────────────────────────────────────────────────────────"
]
},
"execution_count": 59,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"fit(LinearModel, @formula(CRP ~ Age + WCC), data)"
]
},
{
"cell_type": "code",
"execution_count": 60,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table class=\"data-frame\"><thead><tr><th></th><th>N</th></tr><tr><th></th><th>Int64</th></tr></thead><tbody><p>1 rows × 1 columns</p><tr><th>1</th><td>100</td></tr></tbody></table>"
],
"text/latex": [
"\\begin{tabular}{r|c}\n",
"\t& N\\\\\n",
"\t\\hline\n",
"\t& Int64\\\\\n",
"\t\\hline\n",
"\t1 & 100 \\\\\n",
"\\end{tabular}\n"
],
"text/plain": [
"1×1 DataFrame\n",
"│ Row │ N │\n",
"│ │ \u001b[90mInt64\u001b[39m │\n",
"├─────┼───────┤\n",
"│ 1 │ 100 │"
]
},
"execution_count": 60,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"DataFrame(N = size(data,1))"
]
},
{
"cell_type": "code",
"execution_count": 61,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"100"
]
},
"execution_count": 61,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"size(data,1)"
]
},
{
"cell_type": "code",
"execution_count": 63,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table class=\"data-frame\"><thead><tr><th></th><th>Result</th><th>N</th></tr><tr><th></th><th>String</th><th>Int64</th></tr></thead><tbody><p>3 rows × 2 columns</p><tr><th>1</th><td>Worse</td><td>17</td></tr><tr><th>2</th><td>Improved</td><td>21</td></tr><tr><th>3</th><td>Static</td><td>22</td></tr></tbody></table>"
],
"text/latex": [
"\\begin{tabular}{r|cc}\n",
"\t& Result & N\\\\\n",
"\t\\hline\n",
"\t& String & Int64\\\\\n",
"\t\\hline\n",
"\t1 & Worse & 17 \\\\\n",
"\t2 & Improved & 21 \\\\\n",
"\t3 & Static & 22 \\\\\n",
"\\end{tabular}\n"
],
"text/plain": [
"3×2 DataFrame\n",
"│ Row │ Result │ N │\n",
"│ │ \u001b[90mString\u001b[39m │ \u001b[90mInt64\u001b[39m │\n",
"├─────┼──────────┼───────┤\n",
"│ 1 │ Worse │ 17 │\n",
"│ 2 │ Improved │ 21 │\n",
"│ 3 │ Static │ 22 │"
]
},
"execution_count": 63,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"combine(df -> DataFrame(N = size(df,1)), groupby(dataA, :Result))"
]
},
{
"cell_type": "code",
"execution_count": 64,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<table class=\"data-frame\"><thead><tr><th></th><th>Result</th><th>N</th></tr><tr><th></th><th>String</th><th>Int64</th></tr></thead><tbody><p>3 rows × 2 columns</p><tr><th>1</th><td>Static</td><td>11</td></tr><tr><th>2</th><td>Worse</td><td>14</td></tr><tr><th>3</th><td>Improved</td><td>15</td></tr></tbody></table>"
],
"text/latex": [
"\\begin{tabular}{r|cc}\n",
"\t& Result & N\\\\\n",
"\t\\hline\n",
"\t& String & Int64\\\\\n",
"\t\\hline\n",
"\t1 & Static & 11 \\\\\n",
"\t2 & Worse & 14 \\\\\n",
"\t3 & Improved & 15 \\\\\n",
"\\end{tabular}\n"
],
"text/plain": [
"3×2 DataFrame\n",
"│ Row │ Result │ N │\n",
"│ │ \u001b[90mString\u001b[39m │ \u001b[90mInt64\u001b[39m │\n",
"├─────┼──────────┼───────┤\n",
"│ 1 │ Static │ 11 │\n",
"│ 2 │ Worse │ 14 │\n",
"│ 3 │ Improved │ 15 │"
]
},
"execution_count": 64,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"combine(df -> DataFrame(N = size(df,1)), groupby(dataB, :Result))"
]
},
{
"cell_type": "code",
"execution_count": 67,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"2×3 Array{Int64,2}:\n",
" 17 21 22\n",
" 14 15 11"
]
},
"execution_count": 67,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"observed = reshape([17,14,21,15,22,11],(2,3)) #reshape([17,21,22,14,15,11],(2,3))\n",
"observed"
]
},
{
"cell_type": "code",
"execution_count": 68,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"Pearson's Chi-square Test\n",
"-------------------------\n",
"Population details:\n",
" parameter of interest: Multinomial Probabilities\n",
" value under h_0: [0.18600000000000003, 0.124, 0.21600000000000003, 0.14400000000000002, 0.198, 0.132]\n",
" point estimate: [0.17, 0.14, 0.21, 0.15, 0.22, 0.11]\n",
" 95% confidence interval: Tuple{Float64,Float64}[(0.08, 0.2688), (0.05, 0.2388), (0.12, 0.3088), (0.06, 0.2488), (0.13, 0.3188), (0.02, 0.2088)]\n",
"\n",
"Test summary:\n",
" outcome with 95% confidence: fail to reject h_0\n",
" one-sided p-value: 0.6075\n",
"\n",
"Details:\n",
" Sample size: 100\n",
" statistic: 0.9968637992831542\n",
" degrees of freedom: 2\n",
" residuals: [-0.3709911166081349, 0.45436946739765177, -0.12909944487358085, 0.1581138830084189, 0.494413232473044, -0.6055300708194982]\n",
" std. residuals: [-0.7061695217765019, 0.7061695217765013, -0.255155181539915, 0.25515518153991423, 0.9550424786294757, -0.9550424786294757]\n"
]
},
"execution_count": 68,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"ChisqTest(observed)"
]
},
{
"cell_type": "code",
"execution_count": 69,
2020-05-29 18:37:25 +00:00
"metadata": {},
"outputs": [],
"source": [
2020-05-30 02:09:04 +00:00
"CSV.write(\"ProjectData_1_point_0.csv\", data);"
2020-05-29 18:37:25 +00:00
]
2020-05-30 02:09:04 +00:00
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
2020-05-29 18:37:25 +00:00
}
],
"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
}