Vous avez reçu un message "Your GitLab account has been locked ..." ? Pas d'inquiétude : lisez cet article https://docs.gricad-pages.univ-grenoble-alpes.fr/help/unlock/

Commit 72f05318 authored by Laurence Viry's avatar Laurence Viry
Browse files

modif notebook test

parent 29346049
......@@ -14,6 +14,11 @@
"* The empirical variance is $S^2 = \\frac{n}{n-1} \\left(\\frac{X^2_1 +\\ldots + X^2_n}n - \\bar X^2\\right)$.\n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": []
},
{
"cell_type": "markdown",
"metadata": {},
......@@ -25,13 +30,7 @@
"**Example**. For an adult, the logarithm of the D-dimer concentration, denoted by $X$, is modeled by a normal random variable with mean $\\mu$ and standard deviation $\\sigma$. The variable $X$ is an indicator for the risk of thrombosis: it is considered that for healthy individuals, $\\mu$ is −1, whereas for individuals at risk $\\mu$ is 0.\n",
"The influence of olive oil on thrombosis risk must be evaluated.\n",
"A group of 13 patients, previously considered as being at risk, had an olive oil enriched diet. After the diet, their value of $X$ was measured, and this gave an empirical mean of −0.15.\n",
"<\\div>"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"\n",
"The doctor would like to decide if the olive oil diet has improved the D-dimer concentration."
]
},
......@@ -178,20 +177,35 @@
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"execution_count": 1,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"-1.80277563773199"
],
"text/latex": [
"-1.80277563773199"
],
"text/markdown": [
"-1.80277563773199"
],
"text/plain": [
"[1] -1.802776"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"#[#R>>]\n",
"n<-13\n",
"Xbar<--0.15\n",
"sig<-0.3\n",
"mu0<-0\n",
"t<-sqrt(n)*(Xbar-mu0)/sig\n",
"t\n",
"#[#md>]"
"t"
]
},
{
......@@ -285,12 +299,10 @@
}
],
"source": [
"#[#R>>]\n",
"alpha <- 0.05\n",
"n<-13\n",
"qt(alpha/2,n-1)\n",
"qt(1-alpha/2,n-1)\n",
"#[#md>]"
"qt(1-alpha/2,n-1)"
]
},
{
......@@ -311,11 +323,9 @@
},
"outputs": [],
"source": [
"#[#R>>]\n",
"alpha <- 0.05\n",
"n<-13\n",
"qt(alpha,n-1)\n",
"#[#md>]"
"qt(alpha,n-1)"
]
},
{
......@@ -336,11 +346,9 @@
},
"outputs": [],
"source": [
"#[#R>>]\n",
"alpha <- 0.05\n",
"n<-13\n",
"qt(alpha,n-1)\n",
"#[#md>]"
"qt(alpha,n-1)"
]
},
{
......@@ -374,9 +382,7 @@
},
"outputs": [],
"source": [
"#[#R>>]\n",
"qt(0.05,12)\n",
"#[#md>]"
"qt(0.05,12)"
]
},
{
......@@ -396,14 +402,12 @@
},
"outputs": [],
"source": [
"#[#R>>]\n",
"n<-13\n",
"Xbar<--0.15\n",
"s<-0.3\n",
"mu0<-0\n",
"t<-sqrt(n)*(Xbar-mu0)/s\n",
"t\n",
"#[#md>]"
"t"
]
},
{
......@@ -442,11 +446,9 @@
},
"outputs": [],
"source": [
"#[#R>>]\n",
"LenzI <- readRDS(\"data/LenzI.rds\")\n",
"A<-LenzI$age\n",
"t.test(A, mu=60)\n",
"#[#md>]"
"t.test(A, mu=60)"
]
},
{
......@@ -494,10 +496,8 @@
},
"outputs": [],
"source": [
"#[#R>>]\n",
"A<-LenzI$age\n",
"t.test(A, mu=60, alternative= \"greater\")\n",
"#[#md>]"
"t.test(A, mu=60, alternative= \"greater\")"
]
},
{
......@@ -628,9 +628,7 @@
},
"outputs": [],
"source": [
"#[#R>>]\n",
"prop.test(x=74, n= 100, p=0.7, alternative=« greater »)\n",
"#[#md>]"
"prop.test(x=74, n= 100, p=0.7, alternative=« greater »)"
]
},
{
......@@ -720,9 +718,7 @@
},
"outputs": [],
"source": [
"#[#R>>]\n",
"chisq.test(c(1600, 4900, 3500),p=c(0.16, 0.48, 0.36))\n",
"#[#md>]"
"chisq.test(c(1600, 4900, 3500),p=c(0.16, 0.48, 0.36))"
]
},
{
......@@ -808,12 +804,10 @@
},
"outputs": [],
"source": [
"#{#imgAvecCode]\n",
"HY <- read.table(\"data/hypoxy.csv\", header=TRUE, dec=\",\")\n",
"L<-HY$Level\n",
"plot(ecdf(L))\n",
"curve(pnorm(x,mean(L), sd(L)), col=\"red\", add=TRUE)\n",
"#[#}"
"curve(pnorm(x,mean(L), sd(L)), col=\"red\", add=TRUE)"
]
},
{
......@@ -833,9 +827,7 @@
},
"outputs": [],
"source": [
"#[#R>>]\n",
"ks.test(L, \"pnorm\", c(1.2,1))\n",
"#[#md>]"
"ks.test(L, \"pnorm\", c(1.2,1))"
]
},
{
......@@ -864,9 +856,7 @@
},
"outputs": [],
"source": [
"#[#R>>]\n",
"LL<-log(L)\n",
"#[#md>]"
"LL<-log(L)"
]
},
{
......@@ -884,10 +874,8 @@
},
"outputs": [],
"source": [
"#{#img]\n",
"plot(ecdf(LL))\n",
"curve(pnorm(x,mean(LL), sd(LL)), col=\"red\", add=TRUE)\n",
"# [#}"
"curve(pnorm(x,mean(LL), sd(LL)), col=\"red\", add=TRUE)"
]
},
{
......@@ -905,9 +893,7 @@
},
"outputs": [],
"source": [
"#[#R>>]\n",
"ks.test(LL, \"pnorm\", c(0.2,1))\n",
"#[#md>]"
"ks.test(LL, \"pnorm\", c(0.2,1))"
]
},
{
......@@ -968,9 +954,7 @@
},
"outputs": [],
"source": [
"#[#R>>]\n",
"shapiro.test(LL)\n",
"#[#md>]"
"shapiro.test(LL)"
]
},
{
......@@ -996,15 +980,6 @@
"\n",
"<!-- [#case} -->"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment