@@ -520,7 +520,6 @@ _ϕ_ can be computed using the following formula, where _n_ refers to the table:
520520
521521{{if html
522522
523- ``` {lang: null}
524523<div >
525524<style scoped =" scoped " >sub { font-size : 60% ; }</style >
526525<table style =" border-collapse : collapse ; margin-left : 1em ;" ><tr >
@@ -533,32 +532,31 @@ _ϕ_ can be computed using the following formula, where _n_ refers to the table:
533532 </td >
534533</tr ></table >
535534</div >
536- ```
537535
538536if}}
539537
540538{{if tex
541539
542- pass: [ \begin{equation}\varphi = \frac{n_ {11}n_ {00}-n_ {10}n_ {01}}{\sqrt{n_ {1\bullet}n_ {0\bullet}n_ {\bullet1}n_ {\bullet0}}}\end{equation}]
540+ [ \begin{equation}\varphi = \frac{n_ {11}n_ {00}-n_ {10}n_ {01}}{\sqrt{n_ {1\bullet}n_ {0\bullet}n_ {\bullet1}n_ {\bullet0}}}\end{equation}] {latex}
543541
544542if}}
545543
546- The notation (!html _ n_ ~ 01~ !)(!tex pass: [ $n_ {01}$] !) indicates the
544+ The notation [ _ n_ ~ 01~ ] {if html} [[ $n_ {01}$] {latex} ] {if tex} indicates the
547545number of measurements where the first variable (squirrelness) is false
548546(0) and the second variable (pizza) is true (1). In this
549- example, (!html _ n_ ~ 01~ !)(!tex pass: [ $n_ {01}$] !) is 9.
547+ example, [ _ n_ ~ 01~ ] {if html} [[ $n_ {01}$] {latex} ] {if tex} is 9.
550548
551- The value (!html _ n_ ~ 1•~ !)(!tex pass: [ $n_ {1\bullet}$] !) refers to the
549+ The value [ _ n_ ~ 1•~ ] {if html} [[ $n_ {1\bullet}$] {latex} ] {if tex} refers to the
552550sum of all measurements where the first variable is true, which is 5
553- in the example table. Likewise, (!html _ n_ ~ •0~ !)(!tex pass: [ $n_ {\bullet0}$] !)
551+ in the example table. Likewise, [ _ n_ ~ •0~ ] {if html} [[ $n_ {\bullet0}$] {latex} ] {if tex}
554552refers to the sum of the measurements where the second variable is false.
555553
556554{{index correlation, "phi coefficient"}}
557555
558556So for the pizza table, the part
559557above the division line (the dividend) would be 1×76 - 4×9 = 40, and
560558the part below it (the divisor) would be the square root of
561- 5×85×10×80, or (!html √340000!)(!tex pass: [ $\sqrt{340000}$] !) . This
559+ 5×85×10×80, or [ √340000] {if html} [[ $\sqrt{340000}$] {latex} ] {if tex} . This
562560comes out to _ ϕ_ ≈ 0.069, which is tiny. Eating ((pizza)) does not
563561appear to have influence on the transformations.
564562
@@ -605,15 +603,15 @@ This is simply a direct
605603translation of the _ ϕ_ formula into JavaScript. ` Math.sqrt ` is the
606604square root function, as provided by the ` Math ` object in a standard
607605JavaScript environment. We have to sum two fields from the table to
608- get fields like (!html n~ 1•~ !)(!tex pass: [ $n_ {1\bullet}$] !) because
606+ get fields like [ n~ 1•~ ] {if html} [[ $n_ {1\bullet}$] {latex} ] {if tex} because
609607the sums of rows or columns are not stored directly in our data
610608structure.
611609
612610{{index "JOURNAL data set"}}
613611
614612Jacques kept his journal for three months. The
615613resulting ((data set)) is available in the coding sandbox for this
616- chapter(!book ( http://eloquentjavascript.net/code#4[_eloquentjavascript.net/code#4_ ] )!) ,
614+ chapter[ ( http://eloquentjavascript.net/code#4[_eloquentjavascript.net/code#4_ ] )] {if book} ,
617615where it is stored in the ` JOURNAL ` variable, and in a downloadable
618616http://eloquentjavascript.net/code/jacques_journal.js[file ] .
619617
0 commit comments