Cheminformatics/Other/ICT_Sleep_Data_Case_Session.html

361 lines
823 KiB
HTML
Raw Normal View History

2022-12-04 20:38:24 +00:00
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="pandoc" />
<meta name="author" content="Jonathan Herrewijnen" />
<meta name="date" content="2018-09-17" />
<title>Case Study Sleep</title>
<script src="data:application/x-javascript;base64,LyohIGpRdWVyeSB2MS4xMS4zIHwgKGMpIDIwMDUsIDIwMTUgalF1ZXJ5IEZvdW5kYXRpb24sIEluYy4gfCBqcXVlcnkub3JnL2xpY2Vuc2UgKi8KIWZ1bmN0aW9uKGEsYil7Im9iamVjdCI9PXR5cGVvZiBtb2R1bGUmJiJvYmplY3QiPT10eXBlb2YgbW9kdWxlLmV4cG9ydHM/bW9kdWxlLmV4cG9ydHM9YS5kb2N1bWVudD9iKGEsITApOmZ1bmN0aW9uKGEpe2lmKCFhLmRvY3VtZW50KXRocm93IG5ldyBFcnJvcigialF1ZXJ5IHJlcXVpcmVzIGEgd2luZG93IHdpdGggYSBkb2N1bWVudCIpO3JldHVybiBiKGEpfTpiKGEpfSgidW5kZWZpbmVkIiE9dHlwZW9mIHdpbmRvdz93aW5kb3c6dGhpcyxmdW5jdGlvbihhLGIpe3ZhciBjPVtdLGQ9Yy5zbGljZSxlPWMuY29uY2F0LGY9Yy5wdXNoLGc9Yy5pbmRleE9mLGg9e30saT1oLnRvU3RyaW5nLGo9aC5oYXNPd25Qcm9wZXJ0eSxrPXt9LGw9IjEuMTEuMyIsbT1mdW5jdGlvbihhLGIpe3JldHVybiBuZXcgbS5mbi5pbml0KGEsYil9LG49L15bXHNcdUZFRkZceEEwXSt8W1xzXHVGRUZGXHhBMF0rJC9nLG89L14tbXMtLyxwPS8tKFtcZGEtel0pL2dpLHE9ZnVuY3Rpb24oYSxiKXtyZXR1cm4gYi50b1VwcGVyQ2FzZSgpfTttLm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SxjKSxkPT09ITEpYnJlYWt9ZWxzZSBpZ
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link href="data:text/css;charset=utf-8,html%7Bfont%2Dfamily%3Asans%2Dserif%3B%2Dwebkit%2Dtext%2Dsize%2Dadjust%3A100%25%3B%2Dms%2Dtext%2Dsize%2Dadjust%3A100%25%7Dbody%7Bmargin%3A0%7Darticle%2Caside%2Cdetails%2Cfigcaption%2Cfigure%2Cfooter%2Cheader%2Chgroup%2Cmain%2Cmenu%2Cnav%2Csection%2Csummary%7Bdisplay%3Ablock%7Daudio%2Ccanvas%2Cprogress%2Cvideo%7Bdisplay%3Ainline%2Dblock%3Bvertical%2Dalign%3Abaseline%7Daudio%3Anot%28%5Bcontrols%5D%29%7Bdisplay%3Anone%3Bheight%3A0%7D%5Bhidden%5D%2Ctemplate%7Bdisplay%3Anone%7Da%7Bbackground%2Dcolor%3Atransparent%7Da%3Aactive%2Ca%3Ahover%7Boutline%3A0%7Dabbr%5Btitle%5D%7Bborder%2Dbottom%3A1px%20dotted%7Db%2Cstrong%7Bfont%2Dweight%3A700%7Ddfn%7Bfont%2Dstyle%3Aitalic%7Dh1%7Bmargin%3A%2E67em%200%3Bfont%2Dsize%3A2em%7Dmark%7Bcolor%3A%23000%3Bbackground%3A%23ff0%7Dsmall%7Bfont%2Dsize%3A80%25%7Dsub%2Csup%7Bposition%3Arelative%3Bfont%2Dsize%3A75%25%3Bline%2Dheight%3A0%3Bvertical%2Dalign%3Abaseline%7Dsup%7Btop%3A%2D%2E5em%7Dsub%7Bbottom%3A%2D%2E25em%7Dimg%7Bborder%3A0%7Dsvg%3Anot%28%3Aroot%29%7Boverflow%3Ahidden%7Dfigure%7Bmargin%3A1em%2040px%7Dhr%7Bheight%3A0%3B%2Dwebkit%2Dbox%2Dsizing%3Acontent%2Dbox%3B%2Dmoz%2Dbox%2Dsizing%3Acontent%2Dbox%3Bbox%2Dsizing%3Acontent%2Dbox%7Dpre%7Boverflow%3Aauto%7Dcode%2Ckbd%2Cpre%2Csamp%7Bfont%2Dfamily%3Amonospace%2Cmonospace%3Bfont%2Dsize%3A1em%7Dbutton%2Cinput%2Coptgroup%2Cselect%2Ctextarea%7Bmargin%3A0%3Bfont%3Ainherit%3Bcolor%3Ainherit%7Dbutton%7Boverflow%3Avisible%7Dbutton%2Cselect%7Btext%2Dtransform%3Anone%7Dbutton%2Chtml%20input%5Btype%3Dbutton%5D%2Cinput%5Btype%3Dreset%5D%2Cinput%5Btype%3Dsubmit%5D%7B%2Dwebkit%2Dappearance%3Abutton%3Bcursor%3Apointer%7Dbutton%5Bdisabled%5D%2Chtml%20input%5Bdisabled%5D%7Bcursor%3Adefault%7Dbutton%3A%3A%2Dmoz%2Dfocus%2Dinner%2Cinput%3A%3A%2Dmoz%2Dfocus%2Dinner%7Bpadding%3A0%3Bborder%3A0%7Dinput%7Bline%2Dheight%3Anormal%7Dinput%5Btype%3Dcheckbox%5D%2Cinput%5Btype%3Dradio%5D%7B%2Dwebkit%2Dbox%2Dsizing%3Aborder%2Dbox%3B%2Dmoz%2Dbox%2Dsizing%3Aborder%2Dbox%3Bbox%2Dsizing%3Aborder%2Dbox%3Bpadding%3A0%7Dinput%5Btype%3Dnumber%5D%3A%3A%2Dwebkit%2Dinner%2Dspin%2Dbutton%2Cinput%5Btype%3Dnumber%5D%3A%3A%2Dwebkit%2Douter%2Dspin%2Dbutton%7Bheight%3Aauto%7Dinput%5Btype%3Dsearch%5D%7B%2Dwebkit%2Dbox%2Dsizing%3Acontent%2Dbox%3B%2Dmoz%2Dbox%2Dsizing%3Acontent%2Dbox%3Bbox%2Dsizing%3Acontent%2Dbox%3B%2Dwebkit%2Dappearance%3Atextfield%7Dinput%5Btype%3Dsearch%5D%3A%3A%2Dwebkit%2Dsearch%2Dcancel%2Dbutton%2Cinput%5Btype%3Dsearch%5D%3A%3A%2Dwebkit%2Dsearch%2Ddecoration%7B%2Dwebkit%2Dappearance%3Anone%7Dfieldset%7Bpadding%3A%2E35em%20%2E625em%20%2E75em%3Bmargin%3A0%202px%3Bborder%3A1px%20solid%20silver%7Dlegend%7Bpadding%3A0%3Bborder%3A0%7Dtextarea%7Boverflow%3Aauto%7Doptgroup%7Bfont%2Dweight%3A700%7Dtable%7Bborder%2Dspacing%3A0%3Bborder%2Dcollapse%3Acollapse%7Dtd%2Cth%7Bpadding%3A0%7D%40media%20print%7B%2A%2C%3Aafter%2C%3Abefore%7Bcolor%3A%23000%21important%3Btext%2Dshadow%3Anone%21important%3Bbackground%3A0%200%21important%3B%2Dwebkit%2Dbox%2Dshadow%3Anone%21important%3Bbox%2Dshadow%3Anone%21important%7Da%2Ca%3Avisited%7Btext%2Ddecoration%3Aunderline%7Da%5Bhref%5D%3Aafter%7Bcontent%3A%22%20%28%22%20attr%28href%29%20%22%29%22%7Dabbr%5Btitle%5D%3Aafter%7Bcontent%3A%22%20%28%22%20attr%28title%29%20%22%29%22%7Da%5Bhref%5E%3D%22javascript%3A%22%5D%3Aafter%2Ca%5Bhref%5E%3D%22%23%22%5D%3Aafter%7Bcontent%3A%22%22%7Dblockquote%2Cpre%7Bborder%3A1px%20solid%20%23999%3Bpage%2Dbreak%2Dinside%3Aavoid%7Dthead%7Bdisplay%3Atable%2Dheader%2Dgroup%7Dimg%2Ctr%7Bpage%2Dbreak%2Dinside%3Aavoid%7Dimg%7Bmax%2Dwidth%3A100%25%21important%7Dh2%2Ch3%2Cp%7Borphans%3A3%3Bwidows%3A3%7Dh2%2Ch3%7Bpage%2Dbreak%2Dafter%3Aavoid%7D%2Enavbar%7Bdisplay%3Anone%7D%2Ebtn%3E%2Ecaret%2C%2Edropup%3E%2Ebtn%3E%2Ecaret%7Bborder%2Dtop%2Dcolor%3A%23000%21important%7D%2Elabel%7Bborder%3A1px%20solid%20%23000%7D%2Etable%7Bborder%2Dcollapse%3Acollapse%21important%7D%2Etable%20td%2C%2Etable%20th%7Bbackground%2Dcolor%3A%23fff%21important%7D%2Etable%2Dbordered%20td%2C%2Etable%2Dbordered%20th%7Bborder%3A1px%20solid%20%23ddd%21important%7D%7D%40font%2Dface%7Bfont%2Dfamily%3A%27Glyphicons%20Halflings%2
<script src="data:application/x-javascript;base64,LyohCiAqIEJvb3RzdHJhcCB2My4zLjUgKGh0dHA6Ly9nZXRib290c3RyYXAuY29tKQogKiBDb3B5cmlnaHQgMjAxMS0yMDE1IFR3aXR0ZXIsIEluYy4KICogTGljZW5zZWQgdW5kZXIgdGhlIE1JVCBsaWNlbnNlCiAqLwppZigidW5kZWZpbmVkIj09dHlwZW9mIGpRdWVyeSl0aHJvdyBuZXcgRXJyb3IoIkJvb3RzdHJhcCdzIEphdmFTY3JpcHQgcmVxdWlyZXMgalF1ZXJ5Iik7K2Z1bmN0aW9uKGEpeyJ1c2Ugc3RyaWN0Ijt2YXIgYj1hLmZuLmpxdWVyeS5zcGxpdCgiICIpWzBdLnNwbGl0KCIuIik7aWYoYlswXTwyJiZiWzFdPDl8fDE9PWJbMF0mJjk9PWJbMV0mJmJbMl08MSl0aHJvdyBuZXcgRXJyb3IoIkJvb3RzdHJhcCdzIEphdmFTY3JpcHQgcmVxdWlyZXMgalF1ZXJ5IHZlcnNpb24gMS45LjEgb3IgaGlnaGVyIil9KGpRdWVyeSksK2Z1bmN0aW9uKGEpeyJ1c2Ugc3RyaWN0IjtmdW5jdGlvbiBiKCl7dmFyIGE9ZG9jdW1lbnQuY3JlYXRlRWxlbWVudCgiYm9vdHN0cmFwIiksYj17V2Via2l0VHJhbnNpdGlvbjoid2Via2l0VHJhbnNpdGlvbkVuZCIsTW96VHJhbnNpdGlvbjoidHJhbnNpdGlvbmVuZCIsT1RyYW5zaXRpb246Im9UcmFuc2l0aW9uRW5kIG90cmFuc2l0aW9uZW5kIix0cmFuc2l0aW9uOiJ0cmFuc2l0aW9uZW5kIn07Zm9yKHZhciBjIGluIGIpaWYodm9pZCAwIT09YS5zdHlsZVtjXSlyZXR1cm57ZW5kOmJbY119O3JldHVybiExfWEuZm4uZW11bGF0ZVRyYW5zaXRpb25F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D0wO2Zvcih2YXIgRCBpbiBmKWlmKGYuaGFzT3duUHJvcGVydHkoRCkpe3ZhciBFPWouY3JlYXRlRWxlbWVudCgic3R5bGUiKSxGPWZbRF0uam9pbigiXG4iKTtFLnR5cGU9InRleHQvY3NzIixFLm1lZGlhPUQscS5pbnNlc
<script src="data:application/x-javascript;base64,CgovKioKICogalF1ZXJ5IFBsdWdpbjogU3RpY2t5IFRhYnMKICoKICogQGF1dGhvciBBaWRhbiBMaXN0ZXIgPGFpZGFuQHBocC5uZXQ+CiAqIGFkYXB0ZWQgYnkgUnViZW4gQXJzbGFuIHRvIGFjdGl2YXRlIHBhcmVudCB0YWJzIHRvbwogKiBodHRwOi8vd3d3LmFpZGFubGlzdGVyLmNvbS8yMDE0LzAzL3BlcnNpc3RpbmctdGhlLXRhYi1zdGF0ZS1pbi1ib290c3RyYXAvCiAqLwooZnVuY3Rpb24oJCkgewogICJ1c2Ugc3RyaWN0IjsKICAkLmZuLnJtYXJrZG93blN0aWNreVRhYnMgPSBmdW5jdGlvbigpIHsKICAgIHZhciBjb250ZXh0ID0gdGhpczsKICAgIC8vIFNob3cgdGhlIHRhYiBjb3JyZXNwb25kaW5nIHdpdGggdGhlIGhhc2ggaW4gdGhlIFVSTCwgb3IgdGhlIGZpcnN0IHRhYgogICAgdmFyIHNob3dTdHVmZkZyb21IYXNoID0gZnVuY3Rpb24oKSB7CiAgICAgIHZhciBoYXNoID0gd2luZG93LmxvY2F0aW9uLmhhc2g7CiAgICAgIHZhciBzZWxlY3RvciA9IGhhc2ggPyAnYVtocmVmPSInICsgaGFzaCArICciXScgOiAnbGkuYWN0aXZlID4gYSc7CiAgICAgIHZhciAkc2VsZWN0b3IgPSAkKHNlbGVjdG9yLCBjb250ZXh0KTsKICAgICAgaWYoJHNlbGVjdG9yLmRhdGEoJ3RvZ2dsZScpID09PSAidGFiIikgewogICAgICAgICRzZWxlY3Rvci50YWIoJ3Nob3cnKTsKICAgICAgICAvLyB3YWxrIHVwIHRoZS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iLWNvbnRlbnQiPjwvZGl2PicpOwogICAgJCh0YWJzWzBdKS5iZWZvcmUodGFiQ29udGVudCk7CgogICAgLy8gYnVpbGQgdGhlIHRhYnNldAogICAgdmFyIGFjdGl2ZVRhYiA9IDA7CiAgICB0YWJzLmVhY2goZnVuY3Rpb24oaSkgewoKICAgICAgLy8gZ2V0IHRoZSB0YWIgZGl2CiAgICAgIHZhciB0YWIgPSAkKHRhYnNbaV0pOwoKICAgICAgLy8gZ2V0IHRoZSBpZCB0aGVuIHNhbml0aXplIGl0IGZvciB1c2Ugd2l0aCBib290c3RyYXAgdGFicwogICAgICB2YXIgaWQgPSB0YWIuYXR0cignaWQnKTsKCiAgICAgIC8vIHNlZSBpZiB0aGlzIGlzIG1hcmtlZCBhcyB0aGUgYWN0aXZlIHRhYgogICAgICBpZiAodGFiLmhhc0NsYXNzKCdhY3RpdmUnKSkKICAgICAgICBhY3RpdmVUYWIgPSBpOwoKICAgICAgLy8gcmVtb3ZlIGFueSB0YWJsZSBvZiBjb250ZW50cyBlbnRyaWVzIGFzc29jaWF0ZWQgd2l0aAogICAgICAvLyB0aGlzIElEIChzaW5jZSB3ZSdsbCBiZSByZW1vdmluZyB0aGUgaGVhZGluZyBlbGVtZW50KQogICAgICAkKCJkaXYjIiArIHRvY0lEICsgIiBsaSBhW2hyZWY9JyMiICsgaWQgKyAiJ10iKS5wYXJlbnQoKS5yZW1vdmUoKTsKCiAgICAgIC8vIHNhbml0aXplIHRoZSBpZCBmb3IgdXNlIHdpdGggYm9vdHN0cmFwIHRhYnMKICAgICAgaWQgPSBpZC5yZXBsYWNlKC9bLlwvPyYhIzw+XS9nLCAnJykucmVwbGFjZSgvXHMvZywgJ
<link href="data:text/css;charset=utf-8,%2Ehljs%2Dliteral%20%7B%0Acolor%3A%20%23990073%3B%0A%7D%0A%2Ehljs%2Dnumber%20%7B%0Acolor%3A%20%23099%3B%0A%7D%0A%2Ehljs%2Dcomment%20%7B%0Acolor%3A%20%23998%3B%0Afont%2Dstyle%3A%20italic%3B%0A%7D%0A%2Ehljs%2Dkeyword%20%7B%0Acolor%3A%20%23900%3B%0Afont%2Dweight%3A%20bold%3B%0A%7D%0A%2Ehljs%2Dstring%20%7B%0Acolor%3A%20%23d14%3B%0A%7D%0A" rel="stylesheet" />
<script src="data:application/x-javascript;base64,LyohIGhpZ2hsaWdodC5qcyB2OS4xMi4wIHwgQlNEMyBMaWNlbnNlIHwgZ2l0LmlvL2hsanNsaWNlbnNlICovCiFmdW5jdGlvbihlKXt2YXIgbj0ib2JqZWN0Ij09dHlwZW9mIHdpbmRvdyYmd2luZG93fHwib2JqZWN0Ij09dHlwZW9mIHNlbGYmJnNlbGY7InVuZGVmaW5lZCIhPXR5cGVvZiBleHBvcnRzP2UoZXhwb3J0cyk6biYmKG4uaGxqcz1lKHt9KSwiZnVuY3Rpb24iPT10eXBlb2YgZGVmaW5lJiZkZWZpbmUuYW1kJiZkZWZpbmUoW10sZnVuY3Rpb24oKXtyZXR1cm4gbi5obGpzfSkpfShmdW5jdGlvbihlKXtmdW5jdGlvbiBuKGUpe3JldHVybiBlLnJlcGxhY2UoLyYvZywiJmFtcDsiKS5yZXBsYWNlKC88L2csIiZsdDsiKS5yZXBsYWNlKC8+L2csIiZndDsiKX1mdW5jdGlvbiB0KGUpe3JldHVybiBlLm5vZGVOYW1lLnRvTG93ZXJDYXNlKCl9ZnVuY3Rpb24gcihlLG4pe3ZhciB0PWUmJmUuZXhlYyhuKTtyZXR1cm4gdCYmMD09PXQuaW5kZXh9ZnVuY3Rpb24gYShlKXtyZXR1cm4gay50ZXN0KGUpfWZ1bmN0aW9uIGkoZSl7dmFyIG4sdCxyLGksbz1lLmNsYXNzTmFtZSsiICI7aWYobys9ZS5wYXJlbnROb2RlP2UucGFyZW50Tm9kZS5jbGFzc05hbWU6IiIsdD1CLmV4ZWMobykpcmV0dXJuIHcodFsxXSk/dFsxXToibm8taGlnaGxpZ2h0Ijtmb3Iobz1vLnNwbGl0KC9ccysvKSxuP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lLnNwbGl0KCJ8Iik7b1t0WzBdXT1bbix0WzFdP051bWJlcih0WzFdKToxXX0pfTsic3RyaW5nIj09dHlwZW9mIGEuaz91KCJrZXl3b3JkIixhLmspOngoYS5rKS5mb3JFYWNoKGZ1bmN0aW9uKGUpe3UoZSxhLmtbZV0pfSksYS5rPW99YS5sUj10KGEubHx8L1x3Ky8sITApLGkmJihhLmJLJiYoYS5iPSJcXGIoIithLmJLLnNwbGl0KCIgIikuam9pbigifCIpKyIpXFxiIiksYS5ifHwoYS5iPS9cQnxcYi8pLGEuYlI9dChhLmIpLGEuZXx8YS5lV3x8KGEuZT0vXEJ8XGIvKSxhLmUmJihhLmVSPXQoYS5lKSksYS50RT1uKGEuZSl8fCIiLGEuZVcmJmkudEUmJihhLnRFKz0oYS5lPyJ8IjoiIikraS50RSkpLGEuaSYmKGEuaVI9dChhLmkpKSxudWxsPT1hLnImJihhLnI9MSksYS5jfHwoYS5jPVtdKSxhLmM9QXJyYXkucHJvdG90eXBlLmNvbmNhdC5hcHBseShbXSxhLmMubWFwKGZ1bmN0aW9uKGUpe3JldHVybiBsKCJzZWxmIj09PWU/YTplKX0pKSxhLmMuZm9yRWFjaChmdW5jdGlvbihlKXtyKGUsYSl9KSxhLnN0YXJ0cyYmcihhLnN0YXJ0cyxpKTt2YXIgYz1hLmMubWFwKGZ1bmN0aW9uKGUpe3JldHVybiBlLmJLPyJcXC4/KCIrZS5iKyIpXFwuPyI6ZS5ifSkuY29uY2F0KFthLnRFLGEuaV0pLm1hcChuKS5maWx0ZXIoQm9vbGVhbik7YS50PWMubGVuZ3RoP3QoYy5qb2luKCJ8IiksITApOntleGVjOmZ1bmN0aW9uKCl7cmV0dXJuIG51bGx9fX19cihlKX1mdW5jdGlvbiBmKGUsdCxhLGkpe2Z1bmN0aW9uIG8oZSxuKXt2YXIgdCxhO2Zvcih0PTAsYT1uLmMubGVuZ3RoO2E+dDt0K
<style type="text/css">code{white-space: pre;}</style>
<style type="text/css">
pre:not([class]) {
background-color: white;
}
</style>
<script type="text/javascript">
if (window.hljs) {
hljs.configure({languages: []});
hljs.initHighlightingOnLoad();
if (document.readyState && document.readyState === "complete") {
window.setTimeout(function() { hljs.initHighlighting(); }, 0);
}
}
</script>
<style type="text/css">
h1 {
font-size: 34px;
}
h1.title {
font-size: 38px;
}
h2 {
font-size: 30px;
}
h3 {
font-size: 24px;
}
h4 {
font-size: 18px;
}
h5 {
font-size: 16px;
}
h6 {
font-size: 12px;
}
.table th:not([align]) {
text-align: left;
}
</style>
</head>
<body>
<style type="text/css">
.main-container {
max-width: 940px;
margin-left: auto;
margin-right: auto;
}
code {
color: inherit;
background-color: rgba(0, 0, 0, 0.04);
}
img {
max-width:100%;
height: auto;
}
.tabbed-pane {
padding-top: 12px;
}
.html-widget {
margin-bottom: 20px;
}
button.code-folding-btn:focus {
outline: none;
}
</style>
<div class="container-fluid main-container">
<!-- tabsets -->
<script>
$(document).ready(function () {
window.buildTabsets("TOC");
});
</script>
<!-- code folding -->
<div class="fluid-row" id="header">
<h1 class="title toc-ignore">Case Study Sleep</h1>
<h4 class="author"><em>Jonathan Herrewijnen</em></h4>
<h4 class="date"><em>September 17, 2018</em></h4>
</div>
<div id="r-markdown" class="section level2">
<h2>R Markdown</h2>
<p>This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <a href="http://rmarkdown.rstudio.com" class="uri">http://rmarkdown.rstudio.com</a>.</p>
<p>When you click the <strong>Knit</strong> button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:</p>
<pre class="r"><code>summary(cars)</code></pre>
<pre><code>## speed dist
## Min. : 4.0 Min. : 2.00
## 1st Qu.:12.0 1st Qu.: 26.00
## Median :15.0 Median : 36.00
## Mean :15.4 Mean : 42.98
## 3rd Qu.:19.0 3rd Qu.: 56.00
## Max. :25.0 Max. :120.00</code></pre>
</div>
<div id="including-plots" class="section level2">
<h2>Including Plots</h2>
<p>You can also embed plots, for example:</p>
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABUAAAAPACAMAAADDuCPrAAAAXVBMVEUAAAAAADoAAGYAOjoAOpAAZpAAZrY6AAA6OgA6kLY6kNtmAABmtrZmtv+QOgCQZgCQkNuQ29uQ2/+2ZgC2/7a2///bkDrbtmbb/9vb////tmb/25D//7b//9v///+8jXATAAAACXBIWXMAAB2HAAAdhwGP5fFlAAAgAElEQVR4nO3da2PTSICmUdPDwC4s7A7eziwG8v9/5lq+ypcE601FVWWf86UhYLlaiR8kq1RePAMQWdQeAECvBBQgJKAAIQEFCAkoQEhAAUICChASUICQgAKEBBQgJKAAIQEFCAkoQEhAAUICChASUICQgAKEBBQgJKAAIQEFCAkoQEhAAUICChASUICQgAKEBBQgJKAAIQEFCAkoQEhAAUICChASUICQgAKEBBQgJKAAIQEFCAkoQEhAAUICChASUICQgAKEBBQgJKAAIQEFCAkoQEhAAUICChASUICQgAKEBBQgJKAAIQEFCAkoQEhAAUICChASUICQgAKEBBQgJKAAIQEFCAkoQEhAAUICChASUICQgAKEBBQgJKAAIQEFCAkoQEhAAUICChASUICQgAKEBBQgJKAAIQEFCAkoQEhAAUICChASUICQgAKEBBQgJKAAIQEFCAkoQEhAAUICChASUICQgAKEBBQgJKAAIQEFCAkoQEhAAUICChASUICQgAKEBBQgJKAAIQEFCAkoQEhAAUICChASUICQgAKEBBQgJKAAIQEFCAkoQEhAAUICChASUICQgAKEBBQgJKAAIQEFCAkoQEhAAUICChASUICQgAKEBBQgJKAAIQEFCAkoQEhAAUICChASUICQgAKEBBQgJKAAIQEFCAkoQEhAAUICChASUICQgAKEBBQgJKAAIQEFCAkoQEhAAUICChASUICQgAKEBBQgJKAAIQEFCAkoQEhAAUICChASUICQgAKEBBQgJKAAobYDugAopnyiim+xoNp7G7gvxRtVeoNnloeRf5r+4Hf4BwN4WJ0F9Oms/lMbKqBAOV0F9Nfni+Pnf/6dtAUBBcrpKaB/vp8W8/fX9e8//pyyCQEFyukp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L6++ti8eHH89PHn6WfcAoBBcqZKaBDPrcBXSy+lX7GCQQUKGeegG77OQR0uahaUAEFypkloH++LxYff/76vA7oUNB//i39nDcTUKCcWQK6Wiy+PD9vAzqcxH8p/Zw3E1CgnFkCulwMl452AV0fjta7kCSgQDlzBHSdzOGYcxfQ9SFovXN4AQXKmSOgv79urhvtA7oSUOAuCChAqMIp/NJ7oMBdmOki0nDMuQvo+nj0U+nnvJmAAuXMNY3p0z6gw5zQejPpBRQoZ547kTaz5zcBfVosKp7BCyhQ0Ky3cm5VvBFJQIGCZlpMZDhxb6CfAgoUNNtydruEVs2ngAIlWVAZIDTPNKbKx51HAgqUM9NE+rrr0B8JKFDOTLdy1ps6f0pAgXIcgQKE5roTqeYHIY0IKFDOPFfhf31u5BhUQIFyZnoP9JTl7IB7IKAAIQEFCLkTCSAkoAAhAQUICShAyEUkgJCAAoQEFCA093uglRcWEVCgnPkvIj35VE7gPswf0PUxqM+FB+5BhWlMNQ9BBRQop0pAXUQC7kF/AV0eLuYHnxMioEA58wf099c3nMI/nU2ImtpQAQXKmT2gw6TQ9CPmfn1enJt4MCugQDk1JtJ/+JFt+c/302JutjvtaFZAgXJqBPRLuOXVRS6HpE6aEyWgQDnzBzS/grS8fOzUj5wXUKCcjpazWx9uXh67TpxUKqBAOR0FdH20eXm6vpp2RCugQDkCChCaN6DDPKR4EqhTeKAtMwX099eh
<pre><code>## extra group ID
## 1 0.7 1 1
## 2 -1.6 1 2
## 3 -0.2 1 3
## 4 -1.2 1 4
## 5 -0.1 1 5
## 6 3.4 1 6</code></pre>
<pre><code>## extra group ID
## 1 0.7 1 1
## 2 -1.6 1 2
## 3 -0.2 1 3
## 4 -1.2 1 4
## 5 -0.1 1 5
## 6 3.4 1 6
## 7 3.7 1 7
## 8 0.8 1 8
## 9 0.0 1 9
## 10 2.0 1 10
## 11 1.9 2 1
## 12 0.8 2 2
## 13 1.1 2 3
## 14 0.1 2 4
## 15 -0.1 2 5
## 16 4.4 2 6
## 17 5.5 2 7
## 18 1.6 2 8
## 19 4.6 2 9
## 20 3.4 2 10</code></pre>
<p>Note that the <code>echo = FALSE</code> parameter was added to the code chunk to prevent printing of the R code that generated the plot.</p>
<p>We found two groups in our data, but we are not sure whether the second group is our control group or a second medicine. This is not clarified clearly in the data description. So we are assuming that the second group is the control group, but we are not certain.</p>
<p>//OPDRACHTEN - EXERCISES Question 1) Describe the dataset by explaining the variables. If any what are the replicates and/or controls?</p>
<pre class="r"><code>summary(sleep)</code></pre>
<pre><code>## extra group ID
## Min. :-1.600 1:10 1 :2
## 1st Qu.:-0.025 2:10 2 :2
## Median : 0.950 3 :2
## Mean : 1.540 4 :2
## 3rd Qu.: 3.400 5 :2
## Max. : 5.500 6 :2
## (Other):8</code></pre>
<pre class="r"><code>sleep</code></pre>
<pre><code>## extra group ID
## 1 0.7 1 1
## 2 -1.6 1 2
## 3 -0.2 1 3
## 4 -1.2 1 4
## 5 -0.1 1 5
## 6 3.4 1 6
## 7 3.7 1 7
## 8 0.8 1 8
## 9 0.0 1 9
## 10 2.0 1 10
## 11 1.9 2 1
## 12 0.8 2 2
## 13 1.1 2 3
## 14 0.1 2 4
## 15 -0.1 2 5
## 16 4.4 2 6
## 17 5.5 2 7
## 18 1.6 2 8
## 19 4.6 2 9
## 20 3.4 2 10</code></pre>
<pre class="r"><code>?sleep</code></pre>
<pre><code>## starting httpd help server ... done</code></pre>
<p>See the code above, the table “sleep” contains 3 variables, namely: extra, group, ID. -“extra” stands for the extra hours of sleep a student who took a certain drug -“group” stands for the drug a student was given, with 2 different types of drugs -“ID” stands for the patient, one ID per patient/student</p>
<p>20 observations and 3 variables are contained within the table. Second group is the control group.</p>
<p>Question 2) Describe the performed experiment/ analysis. What was of interest/ what was the research question?</p>
<p>Students were given a drug, two seperate groups were created, in which the first group got a sleep prolongation drug, and second group was used as control group. The researchers were interested in the amount of prolonged sleep in hours.</p>
<p>Using ?sleep.</p>
<p>Question 3) Summarize the data statistically.</p>
<p>See the summary and t.test below in the next code snippet box</p>
<p>Question 4) Are there any clear outliers or missing values? If so, which ones?</p>
<p>The boxplot is not showing any outliers, so no outliers are visible.</p>
<pre class="r"><code>require(stats)
#QUESTION THREE
summary(sleep)</code></pre>
<pre><code>## extra group ID
## Min. :-1.600 1:10 1 :2
## 1st Qu.:-0.025 2:10 2 :2
## Median : 0.950 3 :2
## Mean : 1.540 4 :2
## 3rd Qu.: 3.400 5 :2
## Max. : 5.500 6 :2
## (Other):8</code></pre>
<pre class="r"><code>#Simple t.test
with(sleep, t.test(extra[group == 1], extra[group == 2], paired = TRUE))</code></pre>
<pre><code>##
## Paired t-test
##
## data: extra[group == 1] and extra[group == 2]
## t = -4.0621, df = 9, p-value = 0.002833
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -2.4598858 -0.7001142
## sample estimates:
## mean of the differences
## -1.58</code></pre>
<pre class="r"><code>?sleep
?boxplot
#QUESTION FOUR
#Individual plots
boxplot(with(sleep, extra[group==1]))
boxplot(with(sleep, extra[group==2]), add=TRUE)</code></pre>
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABUAAAAPACAMAAADDuCPrAAAAQlBMVEUAAAAAAA0AACgADVEAKIENAAANUbwoAAAogf9RDQBRvLxRvP+BKACBUQ2B//+8UQ28////gSj/vFH//4H//7z////6FfOgAAAACXBIWXMAAB2HAAAdhwGP5fFlAAAZl0lEQVR4nO3d4XZc1bGF0TYGY4KCMOD3f9VIlgE7W2LsXqpy1znM+ScXRnDoVZvvStgkl48ARC63/hMAOCoBBQgJKEBIQAFCAgoQElCAkIAChAQUICSgACEBBQgJKEBIQAFCAgoQElCAkIAChAQUICSgACEBBQgJKEBIQAFCAgoQElCAkIAChAQUICSgACEBBQgJKEBIQAFCAgoQElCAkIAChAQUICSgACEBBQgJKEBIQAFCAgoQElCAkIAChAQUICSgACEBBQgJKEBIQAFCAgoQElCAkIAChAQUICSgACEBBQgJKEBIQAFCAgoQElCAkIAChAQUICSgACEBBQgJKEBI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y/Q5WEBfy1PqY9upXKaPgFLEtlO5TB8BpYhtp3KZPgJKEdtO5TJ9BJQitp3KZfoIKEVsO5XL9BFQith2KpfpI6AUse1ULtNHQCli26lcpo+AUsS2U7lMHwGliG2ncpk+AkoR207lMn0ElCK2ncpl+ggoRWw7lcv0EVCK2HYql+kjoBR57n9Emhlu/TbOS0ApcutI8LJbv43z
<pre class="r"><code>boxplot(with(sleep, extra[group==1], extra[group==2]), paired=TRUE)</code></pre>
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABUAAAAPACAMAAADDuCPrAAAAQlBMVEUAAAAAADoAAGYAOpAAZrY6AAA6kNtmAABmtv+QOgCQ29uQ2/+2ZgC2kDq2///bkDrb////tmb/25D//7b//9v///9qcBDZAAAACXBIWXMAAB2HAAAdhwGP5fFlAAAWoklEQVR4nO3d7XKcZa6G0eYrwCabECDnf6pjJ4FJ5gmUfFui9Zq1/jBJ4S6XpL6m23bC7R0Akdu9PwGAqxJQgJCAAoQEFCAkoAAhAQUICShASEABQgIKEBJQgJCAAoQEFCAkoAAhAQUICShASEABQgIKEBJQgJCAAoQEFCAkoAAhAQUICShASEABQgIKEBJQgJCAAoQEFCAkoAAhAQUICShASEABQgIKEBJQgJCAAoQEFCAkoAAhAQUICShASEABQgIKEBJQgJCAAoQEFCAkoAAhAQUICShASEABQgIKEBJQgJCAAoQEFCAkoAAhAQUICShASEABQgIKEBJQgJCAAoQEFCAkoAAhAQUICShASEABQgIKEBJQgJCAAoQEFCAkoAAhAQUICShASEABQgIKEBJQgJCAAoQEFCAkoAAhAQUICShASEABQgIKEBJQgJCAAoQEFCAkoAAhAQUICShASEABQgIKEBJQgJCAAoQEFCAkoAAhAQUICShASEABQgIKEBJQgJCAAoQEFCAkoAAhAQUICShASEABQgIKEBJQgJCAAoQEFCAkoAAhAQUICShASEABQgIKEBJQgJCAAoQEFCAkoAAhAQUICShASEABQgIKEBJQgJCAAoQEFCAkoAAhAQUICShASEABQgIKEBJQgJCAAo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(sleep, extra[group==2]), add = TRUE)
boxplot(sleep$extra ~ sleep$group, xlab=&quot;Groups&quot;, ylab=&quot;Sleep prolongation (h)&quot;)
points(sleep$extra ~ sleep$group, pch = 1)</code></pre>
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABUAAAAPACAMAAADDuCPrAAAAWlBMVEUAAAAAADoAAGYAOjoAOpAAZpAAZrY6AAA6kNtmAABmAGZmOpBmtrZmtv+QOgCQ29uQ2/+2ZgC2Zma2kDq2/7a2///bkDrbtmbb////tmb/25D//7b//9v///9q61drAAAACXBIWXMAAB2HAAAdhwGP5fFlAAAgAElEQVR4nO3di5rbtpagUTmd9qVn7I5m+miOfHn/1xzdqkSpaBewBYgAuNb3xXEch67aBP+IEkVtfgEQsln6CwDolYACBAkoQJCAAgQJKECQgAIECShAkIACBAkoQJCAAgQJKECQgAIECShAkIACBAkoQJCAAgQJKECQgAIECShAkIACBAkoQJCAAgQJKECQgAIECShAkIACBAkoQJCAAgQJKECQgAIECShAkIACBAkoQJCAAgQJKECQgAIECShAkIACBAkoQJCAAgQJKECQgAIECShAkIACBAkoQJCAAgQJKECQgAIECShAkIACBAkoQJCAAgQJKECQgAIECShAkIACBAkoQJCAAgQJKECQgAIECShAkIACBAkoQJCAAgQJKECQgAIECShAkIACBAkoQJCAAgQJKECQgAIECShAkIACBAkoQJCAAgQJKECQgAIECShAkIACBAkoQJCAAgQJKECQgAIECShAkIACBAkoQJCAAgQJKECQgAIECShAkIACBAkoQJCAAgQJKECQgAIECShAkIACBAkoQJCAAgQJKECQgAIECShAkIACBAkoQJCAAgQJKECQgAIECShAkIACBAkoQJCAAgQJKECQgAIECShAkIACBAkoQJCAAgQJKECQgAIECShAkIACBAkoQJCAAgQJKECQgAIECShAkIACBAkoQJCAAgQJKECQgAIECShAkIACBAkoQJCAAgQJKECQgAIECShAkIACBAkoQJCAAgQJKECQgAIECShAkIACBAkoQJCAAgQJKECQgAIECShAkIACBAkoQJCAAgQJKEBQ2wHd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f0eCFoG49BLfJ3CWiQYbWq34DOfBzSkQvpG3Y+r77+QCLTapWAlvviLPJ3nQp6/su0MphWqwS03Bdnkb9vyJd46jOuVvUb0OZY5Cn0M8K8WiWgxVjkiQwqm5G1SkCLscgTGVQ2I2tVvwH1oXKshrXVqo4D6mONWQtrq1X9BvSQyc2Hf2Z+0/EWy0u8OckipxZrq1UdB/R8M/r7R6HHT/iY7Wp1Fjm1WFut6jmgp9vRH7y+k/Pnt9M/fyz9x6axyKnF2mpV3wGdu5p+sTfGW+TUYm21qvOAvknogvcVscipxdpqVfcB/fV65r5oPX9Z5MkMKpuRtWqEgDbCIk/hrZwR48xrtP0voMWMsygqcjORkGHGNdz+F9BihlkTFbmdXcwo03rd7cPsfwEtZpQlUZEbKgcNMq1JNgf5jgS0nFGWREU+0iNokGFNv40Bv6X2t930zAdZETUJaNAgwxLQhbfd9MwHWRE1CWjQIMMS0IW33fTMB1kRNQlo0CDDEtCFt930zAdZETUNeAA9xyDDGnD/C2gxg6yImgY8gJ5jkGENuP8FtJhBVkRNA17G8hyDTGvA/S+gxYyyJGoa70Lq5xhlWuPtfwEtZpQlUdVwb+V7jmHGNdz+HyCgpxvTv1ri05DOhlkTVQ12/DzJOPMabf/3H9Dd7f2UBZTxWFut6j6g+42AdsagshlZq7oP6HbJZt6wyBMZVDYja1XvAf35rZV+WuSpDCqbkbWq94D++LLIZ8DPscgTGVQ2I2uVgBZjkScyqGxG1qreA3o4hRfQzhhUNiNrVe8B/bVb+LM4ryzyRAaVzcha1X1A2zmHt8gTGVQ2I2tV9wE9
<p>Question 5) Summarize the data graphically using only 1 figure. Choose a figure that summarizes the data adequately. Use the graphical package ggplot2. Explain your choice.</p>
<p>We have two groups and only one variable. So a boxplot is a logical choice for comparing both datasets.</p>
<pre class="r"><code>library(ggplot2)
ggplot(sleep, aes(x=group, y=extra)) + geom_boxplot()</code></pre>
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABUAAAAPACAMAAADDuCPrAA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y1DbCegUAsq1DLWdgE4hoFzLUNsJ6BQCyrUMtZ2ATiGgXMtQ2wnoFALKtQy1nYBOIaBcK74z5xPQKeLHsLxHQPcX35nzCegU8WNY3iOg+4vvzPkEdIr4MSzvEdD9xXfmfAI6RfwYlvcI6P7iO3M+AZ0ifgzLewR0f/GdOZ+AThE/huU9Arq/+M6cT0CniB/D8h4B3V98Z84noFPEj2F5j4DuL74z5xPQKeLHsLxHQPcX35nzCegU8WNY3iOg+4vvzPkEdIr4MSzvEdD9xXfmfAI6RfwYlvcI6P7iO3M+AZ0ifgzLewR0f/GdOZ+AThE/huU9Arq/+M6cT0CniB/D8h4B3V98Z84noFPEj2F5j4DuL74z5xPQKeLHsLxHQPcX35nzCegU8WNY3iOg+4vvzPkEdIr4MSzvEdD9xXfmfAI6RfwYlvcI6P7iO3M+AZ0ifgzLewR0f/GdOZ+AThE/huU9Arq/+M6cT0CniB/D8h4B3V98Z84noFPEj2F5j4DuL74z5xPQKeLHsLxHQPcX35nzCegU8WNY3iOg+4vvzPkEdIr4MSzvEdD9xXfmfAI6RfwYlvcI6P7iO3M+AZ0ifgzLewR0f/GdOZ+AThE/huU9Arq/+M6cT0CniB/D8h4B3V98Z84noFPEj2F5j4DuL74z5xPQKeLHsLxHQPcX35nzCegU8WNY3iOg+4vvzPkEdIr4MSzvEdD9xXfmfAI6RfwYlvcI6P7iO3M+AZ0ifgzLewR0f/GdOZ+AThE/huU9Arq/+M6cT0CniB/D8h4B3V98Z84noFPEj2F5j4DuL74z5xPQKeLHsLxHQPcX35nzCegU8WNY3iOg+4vvzPkEdIr4MSzvEdD9xXfmfAI6RfwYlvcI6P7i
<p>Question 6) Explore the data, include check for distribution/ normality range of variables mention number and type of variables and observations</p>
<pre class="r"><code>#Checking for distribution using a QQplot
par(mfrow=c(2, 1)) #plots 2 graphs
with(sleep, hist(extra[group==1]))
with(sleep, hist(extra[group==2]))</code></pre>
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABUAAA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AAYESBAoARBQoARhQoABhRoABgRIECgBEFCgBGFCgAGFGgAGBEgQKAEQUKAEYUKAAYUaAAYESBAoARBQoARhQoABhRoABgRIECgBEFCgBGFCgAGFGgAGBEgQKAEQUKAEYUKAAYUaAAYESBAoDRvEB//vOPDDkAwJ1IgX49nV4yJAEAZ+IFWnrLEAYAPIkdAz2fGu9PTwMAjiycRCqaCv38x3PTAIAji2fhf31rOvQLp5QAIOrWNKb2aCinlAAg5s480HY79NP356QBAEduFmh3NomtUACYWy7Qc38eqd4MZVoTAIwtFOhkJtPPr5yQB4CJW/NAg43OggIFgInFK5FG05fKnXimMwHAWLxAOesOAHfFCpRLOAFgBe4HCgBG8QI9N6fff3595qmj09zznvyJIsspKvdIAepiK0l1FLQu0I/XZ86g/z1W4WeX4CNyjxWgLrKSDPPmL9ValPEapCOuwn6WyU9SIJfISnIOzsJXU0LznVM64irsZ5n8JAVyma8k5QZocOSz3IvPtwl6xFXYzzL5SQrkEp0HGl73fs44hf6Iq7CfZfKTFMglWqDhTvsl40WcR1yF/SyTn6RALhTok/lZJj9JgVyix0DDnfaCXfik/CyTn6RALvGz8MNB0EvOO4EecRX2s0x+kgK5RFaS4G4i1ZcZ72N3xFXYzzL5SQrkEltJLqPLUTLeWuSIq7CfZfKTFMglupJUl3C2st7Y7oirsJ9l8pMUyGVhJWnvqpz5vqBHXIX9LJOfpEAu0ivJEVdh
<p>No distribution seems to be visible (if so, then a bell curve would be expected)</p>
<p>Question 7) Calculate the mean sleep prolongation of the two drugs using the aggregate function on the sleep data frame.</p>
<pre class="r"><code>#Calculate mean sleep
aggregate(formula = extra~group, data = sleep, FUN = mean)</code></pre>
<pre><code>## group extra
## 1 1 0.75
## 2 2 2.33</code></pre>
<p>See function above, results are 0.75 hours and 2.33 hours extra sleep for drug one and two respectively</p>
<p>Question 8) Calculate the difference in sleep prolongation based on drug type for each patient. Store this new dataset in a new data frame including patient number. Do this by writing a function with as input argument the sleep data frame and as output the new data frame.</p>
<pre class="r"><code>my_dataframe &lt;- data.frame(with(sleep, extra[group==1]-extra[group==2]))
my_dataframe</code></pre>
<pre><code>## with.sleep..extra.group....1....extra.group....2..
## 1 -1.2
## 2 -2.4
## 3 -1.3
## 4 -1.3
## 5 0.0
## 6 -1.0
## 7 -1.8
## 8 -0.8
## 9 -4.6
## 10 -1.4</code></pre>
<p>See above.</p>
<p>Question 9) Is the sleep prolongation difference between the drugs (more) normaly distributed?</p>
<pre class="r"><code>shapiro.test(sleep$extra)</code></pre>
<pre><code>##
## Shapiro-Wilk normality test
##
## data: sleep$extra
## W = 0.94607, p-value = 0.3114</code></pre>
<pre class="r"><code>hist(sleep$extra)</code></pre>
<p><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAABUAAAAPACAMAAADDuCPrAAAAgVBMVEUAAAAAADoAAGYAOjoAOmYAOpAAZpAAZrY6AAA6OgA6Ojo6kLY6kNtmAABmOgBmOpBmZgBmZjpmZmZmtttmtv+QOgCQkDqQkNuQtpCQ29uQ2/+2ZgC2kDq225C2/7a2/9u2///bkDrbtmbb25Db/9vb////tmb/25D//7b//9v///9/qH8GAAAACXBIWXMAAB2HAAAdhwGP5fFlAAAgAElEQVR4nO3d6YIaSZNmYUpfq6WZyerZpFmKWYqeFqrS/V/gsBNAkAlOkGae9pw/JaGEY+6YvxV7zn4BAJqYRRcAAL0iQAGgEQEKAI0IUABoRIACQCMCFAAaEaAA0IgABYBGBCgANCJAAaARAQoAjQhQAGhEgAJAIwIUABoRoADQiAAFgEYEKAA0IkABoBEBCgCNCFAAaESAAkAjAhQAGhGgANCIAAWARgQoADQiQAGgEQEKAI0IUABoRIACQCMCFAAaEaAA0IgABYBGBCgANCJAAaARAQoAjQhQAGhEgAJAIwIUABoRoADQiAAFgEYEKAA0IkABoBEBCgCNCFAAaESAAkAjAhQAGhGgANCIAAWARgQoADQiQAGgEQEKAI0IUABoRIACQCMCFAAaEaAA0IgABYBGBCgANCJAAaARAQoAjQhQAGhEgAJAIwIUABoRoADQiAA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LUP6P6kdZ3qvz5gKU/8P6UZbUndfNuogulD/Wj7Kk7rxu1kV0ofyxfpQlded1
<p>So the p-value here is 0.3114, meaning that it differs signifcantly from a normal distribution. We can not assume that the data is normaly distributed.</p>
<p>Question 10) Was there a significant difference in sleep prolongation between the drugs? Mention the effect size, is this of a relevant magnitude? Explain why.</p>
<p>Also explain why you chose this specific test.</p>
<pre class="r"><code>ThisData &lt;- data.frame(with(sleep, mean(extra[group==1])), with(sleep, mean(extra[group==2])))
ThisData</code></pre>
<pre><code>## with.sleep..mean.extra.group....1...
## 1 0.75
## with.sleep..mean.extra.group....2...
## 1 2.33</code></pre>
<pre class="r"><code>with(sleep, t.test(extra[group == 1], extra[group == 2], paired = TRUE))</code></pre>
<pre><code>##
## Paired t-test
##
## data: extra[group == 1] and extra[group == 2]
## t = -4.0621, df = 9, p-value = 0.002833
## alternative hypothesis: true difference in means is not equal to 0
## 95 percent confidence interval:
## -2.4598858 -0.7001142
## sample estimates:
## mean of the differences
## -1.58</code></pre>
<p>The mean between both drugs is very different, 0.75 to 2.33, implying a difference.</p>
<p>The t.test shows a difference of -1.58 between the test with a reliability of 0.002833.</p>
</div>
</div>
<script>
// add bootstrap table styles to pandoc tables
function bootstrapStylePandocTables() {
$('tr.header').parent('thead').parent('table').addClass('table table-condensed');
}
$(document).ready(function () {
bootstrapStylePandocTables();
});
</script>
<!-- dynamically load mathjax for compatibility with self-contained -->
<script>
(function () {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = "https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML";
document.getElementsByTagName("head")[0].appendChild(script);
})();
</script>
</body>
</html>