Skip to content

Commit e79862f

Browse files
chp3 smoking example needs work. The analysis is wrong as I susptect the data may be wrong
1 parent 420b37c commit e79862f

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

Chapter3_MCMC/IntroMCMC.ipynb

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@
272272
"metadata": {},
273273
"source": [
274274
"_____\n",
275-
"### Example: Poisson Regression\n",
275+
"### Example: Poisson Regression [Needs work]\n",
276276
"\n",
277277
"Perhaps the most important result from medical research was the *now obvious* link between *smoking and cancer*. We'll try to establish a link using Bayesian methods. We have a decision here: should we include a prior that biases us towards there existing a significant link between smoking and cancer? I think we should act like scientists at the turn of the century, and assume there's is no *a priori* reason to assume a link. \n",
278278
"\n",
@@ -353,7 +353,26 @@
353353
]
354354
}
355355
],
356-
"prompt_number": 8
356+
"prompt_number": 1
357+
},
358+
{
359+
"cell_type": "code",
360+
"collapsed": false,
361+
"input": [
362+
"(population*100000)"
363+
],
364+
"language": "python",
365+
"metadata": {},
366+
"outputs": [
367+
{
368+
"output_type": "pyout",
369+
"prompt_number": 5,
370+
"text": [
371+
"5612200000.0"
372+
]
373+
}
374+
],
375+
"prompt_number": 5
357376
},
358377
{
359378
"cell_type": "markdown",
@@ -550,7 +569,7 @@
550569
"plt.legend(loc=\"upper left\")\n",
551570
"plt.xlabel( \"age\" )\n",
552571
"plt.ylabel(\"expected death rate (deaths/population)\" )\n",
553-
"plt.title( \"Expected deaths rate; partitioned by smoking habits\")\n",
572+
"plt.title( \"Expected death rate; partitioned by smoking habits\")\n",
554573
"plt.xlim( 42, 87 )"
555574
],
556575
"language": "python",
@@ -576,7 +595,7 @@
576595
"source": [
577596
"**Clearly** smoking affects how long you live. \n",
578597
"\n",
579-
"We can interpret these rates are probabilities, for example, 0.032 is the rate of a non-smokers dying at age 40, which is equilivant to the probablity of a randomly selected non-smoker aged 40-45 will die. Hence 1- 0.032 = 0.968 is the probability he/she survives to 45. Similarly, with probability 0.045 a 45-50 year old non-smoker will survive until age 50. Hence, (1- 0.032)(1 - 0.045) is the probability a non-smoker, aged 40 will survive until 50, and so on. Let's plot this."
598+
"We can interpret these rates as probabilities, for example, 0.032 is the rate of 40-45 non-smokers dying each year, which is equilivant to the probablity of a randomly selected non-smoker aged 40-45 will die within a year. Hence 1- 0.032 = 0.968 is the probability he/she survives to 45. Similarly, with probability 0.045, a 45-50 year old non-smoker will survive until age 50. Hence, (1- 0.032)(1 - 0.045) is the probability a non-smoker, aged 40 will survive until 50, and so on. Let's plot this."
580599
]
581600
},
582601
{

0 commit comments

Comments
 (0)