-
Notifications
You must be signed in to change notification settings - Fork 34
/
spearman.Rmd
43 lines (32 loc) · 872 Bytes
/
spearman.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# Spearman Rank Correlation Coefficient
<style>
h2, h3, p, text {
font-family: sans-serif;
text-anchor: middle;
}
.rank {
fill: white;
font-weight: bold;
dominant-baseline: central; /* https://stackoverflow.com/questions/12250403/vertical-alignment-of-text-element-in-svg */
}
#rho {
font-family: serif;
font-size: 18pt;
}
</style>
<table>
<td>
<div id="spearman">
</td>
<td>
Drag the circles to reorder the rankings in Groups A & B. The correlation coefficient, $\rho$, is displayed below.
<br>
<br>
$\LARGE \rho = 1 - \frac{6 \Sigma{d_i^2}}{n(n^2 -1)} =$
<h4 id="rho"></h4>
$d_{i}$ = difference between the two ranks of each observation
$n$ = number of observations
</td>
</table>
<script src="https://d3js.org/d3.v7.min.js"></script>
<script src="scripts/spearman.js"></script>