Skip to content

Commit 9a065b6

Browse files
committed
update statistics notebooks except polychoric
and tetrachoric
1 parent 95d6a43 commit 9a065b6

11 files changed

+840
-548
lines changed

Statistics/Correlation Matrix with daru and statsample.ipynb

+69-29
Original file line numberDiff line numberDiff line change
@@ -11,66 +11,106 @@
1111
},
1212
{
1313
"cell_type": "code",
14-
"execution_count": 12,
14+
"execution_count": 1,
1515
"metadata": {
1616
"collapsed": false
1717
},
1818
"outputs": [
1919
{
2020
"data": {
21+
"application/javascript": [
22+
"if(window['d3'] === undefined ||\n",
23+
" window['Nyaplot'] === undefined){\n",
24+
" var path = {\"d3\":\"https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min\",\"downloadable\":\"https://cdn.rawgit.com/domitry/d3-downloadable/master/d3-downloadable\"};\n",
25+
"\n",
26+
"\n",
27+
"\n",
28+
" var shim = {\"d3\":{\"exports\":\"d3\"},\"downloadable\":{\"exports\":\"downloadable\"}};\n",
29+
"\n",
30+
" require.config({paths: path, shim:shim});\n",
31+
"\n",
32+
"\n",
33+
"require(['d3'], function(d3){window['d3']=d3;console.log('finished loading d3');require(['downloadable'], function(downloadable){window['downloadable']=downloadable;console.log('finished loading downloadable');\n",
34+
"\n",
35+
"\tvar script = d3.select(\"head\")\n",
36+
"\t .append(\"script\")\n",
37+
"\t .attr(\"src\", \"https://cdn.rawgit.com/domitry/Nyaplotjs/master/release/nyaplot.js\")\n",
38+
"\t .attr(\"async\", true);\n",
39+
"\n",
40+
"\tscript[0][0].onload = script[0][0].onreadystatechange = function(){\n",
41+
"\n",
42+
"\n",
43+
"\t var event = document.createEvent(\"HTMLEvents\");\n",
44+
"\t event.initEvent(\"load_nyaplot\",false,false);\n",
45+
"\t window.dispatchEvent(event);\n",
46+
"\t console.log('Finished loading Nyaplotjs');\n",
47+
"\n",
48+
"\t};\n",
49+
"\n",
50+
"\n",
51+
"});});\n",
52+
"}\n"
53+
],
2154
"text/plain": [
22-
"\"== DataFrame ==\\n\""
55+
"\"if(window['d3'] === undefined ||\\n window['Nyaplot'] === undefined){\\n var path = {\\\"d3\\\":\\\"https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min\\\",\\\"downloadable\\\":\\\"https://cdn.rawgit.com/domitry/d3-downloadable/master/d3-downloadable\\\"};\\n\\n\\n\\n var shim = {\\\"d3\\\":{\\\"exports\\\":\\\"d3\\\"},\\\"downloadable\\\":{\\\"exports\\\":\\\"downloadable\\\"}};\\n\\n require.config({paths: path, shim:shim});\\n\\n\\nrequire(['d3'], function(d3){window['d3']=d3;console.log('finished loading d3');require(['downloadable'], function(downloadable){window['downloadable']=downloadable;console.log('finished loading downloadable');\\n\\n\\tvar script = d3.select(\\\"head\\\")\\n\\t .append(\\\"script\\\")\\n\\t .attr(\\\"src\\\", \\\"https://cdn.rawgit.com/domitry/Nyaplotjs/master/release/nyaplot.js\\\")\\n\\t .attr(\\\"async\\\", true);\\n\\n\\tscript[0][0].onload = script[0][0].onreadystatechange = function(){\\n\\n\\n\\t var event = document.createEvent(\\\"HTMLEvents\\\");\\n\\t event.initEvent(\\\"load_nyaplot\\\",false,false);\\n\\t window.dispatchEvent(event);\\n\\t console.log('Finished loading Nyaplotjs');\\n\\n\\t};\\n\\n\\n});});\\n}\\n\""
2356
]
2457
},
2558
"metadata": {},
2659
"output_type": "display_data"
2760
},
61+
{
62+
"name": "stdout",
63+
"output_type": "stream",
64+
"text": [
65+
"== DataFrame ==\n",
66+
"\n"
67+
]
68+
},
2869
{
2970
"data": {
3071
"text/html": [
31-
"<table><tr><th></th><th>a</th><th>b</th><th>c</th><th>d</th></tr><tr><td>0</td><td>-2.440821265161855</td><td>-0.2663867705446803</td><td>-0.9667049163587536</td><td>-0.6247662665284197</td></tr><tr><td>1</td><td>-0.9973263526986711</td><td>0.8965870460177997</td><td>-0.4924093636219239</td><td>-1.0325364294957489</td></tr><tr><td>2</td><td>-0.2744289410160191</td><td>1.8088687531883922</td><td>-0.5910605176882341</td><td>1.3789993200304744</td></tr><tr><td>3</td><td>1.8688690135894495</td><td>-0.5845393024341371</td><td>2.140052050767279</td><td>-0.11879447826728619</td></tr><tr><td>4</td><td>1.0841575504132723</td><td>0.29819461734869424</td><td>0.5801339485682966</td><td>1.935529360750203</td></tr><tr><td>5</td><td>0.8365312603239075</td><td>-2.592250495057871</td><td>-0.5377005060865632</td><td>-1.3156474227148434</td></tr><tr><td>6</td><td>-0.6143096811863075</td><td>0.9303368054803663</td><td>-0.2762842748435172</td><td>0.695374402222615</td></tr><tr><td>7</td><td>0.9288749463298932</td><td>0.17342875610525094</td><td>-0.18948493978562986</td><td>0.5439278783192012</td></tr><tr><td>8</td><td>-1.2315590581627647</td><td>-0.5070225404828463</td><td>0.7560851316374544</td><td>-0.5377282599496545</td></tr><tr><td>9</td><td>-0.8552039210385985</td><td>0.1061517520214962</td><td>-1.2859991357392173</td><td>-0.7772438525282614</td></tr><tr><td>10</td><td>0.109004152753796</td><td>-0.5146703134593364</td><td>1.6338786244674606</td><td>-0.39285194944821017</td></tr></table>"
72+
"<table><tr><th colspan=\"5\">Daru::DataFrame:13085860 rows: 10 cols: 4<tr><th></th><th>a</th><th>b</th><th>c</th><th>d</th></tr><tr><td>0</td><td>0.9011467513657144</td><td>-2.0698264996309637</td><td>-0.05424188567538422</td><td>-0.21497530674467752</td></tr><tr><td>1</td><td>0.3477390529339665</td><td>1.9693799988325165</td><td>0.6438210000373529</td><td>0.2691070769303308</td></tr><tr><td>2</td><td>1.169337960514499</td><td>-1.2003500655322563</td><td>-1.8876472885285303</td><td>-0.21250262336698017</td></tr><tr><td>3</td><td>-2.0149242228225352</td><td>0.3777196093249942</td><td>0.233921550979305</td><td>0.39979121524058253</td></tr><tr><td>4</td><td>-0.8464428241042591</td><td>-1.4782182304742935</td><td>0.22458711725118236</td><td>-0.33396263618551913</td></tr><tr><td>5</td><td>1.2471920549543476</td><td>-0.887490499184695</td><td>-1.1041991362454315</td><td>1.932482592873003</td></tr><tr><td>6</td><td>-0.8529853403070782</td><td>-0.4909368945208435</td><td>-0.7306423975841205</td><td>0.8578541353085531</td></tr><tr><td>7</td><td>-0.38470545324770017</td><td>0.4812878996742971</td><td>0.565122377348464</td><td>-1.277608770535443</td></tr><tr><td>8</td><td>1.2856180977412772</td><td>-1.288566320945822</td><td>-1.7868746145697005</td><td>1.0500431060289053</td></tr><tr><td>9</td><td>0.5182738763941376</td><td>0.36345933022878907</td><td>-0.46301077093228676</td><td>0.4544283438001362</td></tr></table>"
3273
],
3374
"text/plain": [
3475
"\n",
35-
"#<Daru::DataFrame:71846410 @name = a20e6c09-edb7-4bd3-940d-e1dd3b06ac08 @size = 11>\n",
76+
"#<Daru::DataFrame:13085860 @name = 6af7475c-ef7e-4016-9dd3-d42753234c08 @size = 10>\n",
3677
" a b c d \n",
37-
" 0 -2.4408212 -0.2663867 -0.9667049 -0.6247662 \n",
38-
" 1 -0.9973263 0.89658704 -0.4924093 -1.0325364 \n",
39-
" 2 -0.2744289 1.80886875 -0.5910605 1.37899932 \n",
40-
" 3 1.86886901 -0.5845393 2.14005205 -0.1187944 \n",
41-
" 4 1.08415755 0.29819461 0.58013394 1.93552936 \n",
42-
" 5 0.83653126 -2.5922504 -0.5377005 -1.3156474 \n",
43-
" 6 -0.6143096 0.93033680 -0.2762842 0.69537440 \n",
44-
" 7 0.92887494 0.17342875 -0.1894849 0.54392787 \n",
45-
" 8 -1.2315590 -0.5070225 0.75608513 -0.5377282 \n",
46-
" 9 -0.8552039 0.10615175 -1.2859991 -0.7772438 \n",
47-
" 10 0.10900415 -0.5146703 1.63387862 -0.3928519 \n"
78+
" 0 0.90114675 -2.0698264 -0.0542418 -0.2149753 \n",
79+
" 1 0.34773905 1.96937999 0.64382100 0.26910707 \n",
80+
" 2 1.16933796 -1.2003500 -1.8876472 -0.2125026 \n",
81+
" 3 -2.0149242 0.37771960 0.23392155 0.39979121 \n",
82+
" 4 -0.8464428 -1.4782182 0.22458711 -0.3339626 \n",
83+
" 5 1.24719205 -0.8874904 -1.1041991 1.93248259 \n",
84+
" 6 -0.8529853 -0.4909368 -0.7306423 0.85785413 \n",
85+
" 7 -0.3847054 0.48128789 0.56512237 -1.2776087 \n",
86+
" 8 1.28561809 -1.2885663 -1.7868746 1.05004310 \n",
87+
" 9 0.51827387 0.36345933 -0.4630107 0.45442834 \n"
4888
]
4989
},
5090
"metadata": {},
5191
"output_type": "display_data"
5292
},
5393
{
54-
"data": {
55-
"text/plain": [
56-
"\"\\n== Correlation Matrix ==\\n\""
57-
]
58-
},
59-
"metadata": {},
60-
"output_type": "display_data"
94+
"name": "stdout",
95+
"output_type": "stream",
96+
"text": [
97+
"\n",
98+
"== Correlation Matrix ==\n",
99+
"\n"
100+
]
61101
},
62102
{
63103
"data": {
64104
"text/latex": [
65105
"$$\\left(\\begin{array}{cccc}\n",
66-
" 1.0&-0.07093352677886748&0.013477672801161788&0.051849860816432954\\\\\n",
67-
" -0.07093352677886748&1.0&0.010458169946423295&0.0163511125525614\\\\\n",
68-
" 0.013477672801161788&0.010458169946423295&1.0&0.01824910238325418\\\\\n",
69-
" 0.051849860816432954&0.0163511125525614&0.01824910238325418&1.0\\\\\n",
106+
" 1.0&-0.01467367745077135&0.011913969445518504&-0.0034212506073735397\\\\\n",
107+
" -0.01467367745077135&1.0&-0.04653177857574501&0.022525025891610012\\\\\n",
108+
" 0.011913969445518504&-0.04653177857574501&1.0&0.031949296919919545\\\\\n",
109+
" -0.0034212506073735397&0.022525025891610012&0.031949296919919545&1.0\\\\\n",
70110
"\\end{array}\\right)$$"
71111
],
72112
"text/plain": [
73-
"Matrix[[1.0, -0.07093352677886748, 0.013477672801161788, 0.051849860816432954], [-0.07093352677886748, 1.0, 0.010458169946423295, 0.0163511125525614], [0.013477672801161788, 0.010458169946423295, 1.0, 0.01824910238325418], [0.051849860816432954, 0.0163511125525614, 0.01824910238325418, 1.0]]"
113+
"Matrix[[1.0, -0.01467367745077135, 0.011913969445518504, -0.0034212506073735397], [-0.01467367745077135, 1.0, -0.04653177857574501, 0.022525025891610012], [0.011913969445518504, -0.04653177857574501, 1.0, 0.031949296919919545], [-0.0034212506073735397, 0.022525025891610012, 0.031949296919919545, 1.0]]"
74114
]
75115
},
76116
"metadata": {},
@@ -80,7 +120,7 @@
80120
"name": "stdout",
81121
"output_type": "stream",
82122
"text": [
83-
"Analysis 2015-06-03 15:17:33 +0530\n",
123+
"Analysis 2016-03-24 11:58:04 +0000\n",
84124
"= Statsample::Bivariate.correlation_matrix\n",
85125
"\n"
86126
]
@@ -143,7 +183,7 @@
143183
"name": "ruby"
144184
},
145185
"language_info": {
146-
"file_extension": "rb",
186+
"file_extension": ".rb",
147187
"mimetype": "application/x-ruby",
148188
"name": "ruby",
149189
"version": "2.2.1"

0 commit comments

Comments
 (0)