| Sample | X1 | X2 | M |
|---|---|---|---|
| 1 | 60 | 60 | 60 |
| 2 | 62 | 60 | 61 |
| 3 | 64 | 60 | 62 |
| 4 | 66 | 60 | 63 |
| 5 | 60 | 62 | 61 |
| 6 | 62 | 62 | 62 |
| 7 | 64 | 62 | 63 |
| 8 | 66 | 62 | 64 |
| 9 | 60 | 64 | 62 |
| 10 | 62 | 64 | 63 |
| 11 | 64 | 64 | 64 |
| 12 | 66 | 64 | 65 |
| 13 | 60 | 66 | 63 |
| 14 | 62 | 66 | 64 |
| 15 | 64 | 66 | 65 |
| 16 | 66 | 66 | 66 |
pnorm()| Sample | X1 | X2 | M |
|---|---|---|---|
| 1 | 60 | 60 | 60 |
| 2 | 62 | 60 | 61 |
| 3 | 64 | 60 | 62 |
| 4 | 66 | 60 | 63 |
| 5 | 60 | 62 | 61 |
| 6 | 62 | 62 | 62 |
| 7 | 64 | 62 | 63 |
| 8 | 66 | 62 | 64 |
| 9 | 60 | 64 | 62 |
| 10 | 62 | 64 | 63 |
| 11 | 64 | 64 | 64 |
| 12 | 66 | 64 | 65 |
| 13 | 60 | 66 | 63 |
| 14 | 62 | 66 | 64 |
| 15 | 64 | 66 | 65 |
| 16 | 66 | 66 | 66 |
\(p(M < 61) =\ ?\)
\(\mu_M = \mu \ \ \ \ \ \ \ \ \ \ \sigma_M = \dfrac{\sigma}{\sqrt{n}}\)
pnorm(), just like for regular \(z\)-scores)\(z = \dfrac{M-\mu_M}{\sigma_M}\)
Treatment
Original
population
Treated
population
Sample
Treated sample

\(z = \dfrac{X-\mu}{\sigma} = \dfrac{159 - 284}{50} = -2.5\)
Treatment
Known
original
population
Unknown
treated
population
Sample
Treated
sample
💊🧠
🦸♀ 😎️
🎓🤑
Treatment
Known
original
population
\(\mu, \sigma\)
Unknown
treated
population
Sample
Treated sample
\(M, n\)
Does CBT affect OCD? (Abramowitz et al., 2010)
State hypotheses
Set decision criteria
Collect data; compute statistics & probabilities
Pre-treatment \(\mu = 30.25\); \(\sigma = 14.89\)
Treated sample \(M = 15.49\); \(n = 40\)
Make decision
jStat = require("https://cdn.jsdelivr.net/npm/jstat@latest/dist/jstat.min.js")
cover = {
const w = 1050
const h = 525
const x = d3.scaleLinear()
.domain([-3, 3])
.range([0, w])
const y = d3.scaleLinear()
.domain([0, 0.41])
.range([h, 0])
const line = d3.line()
.x(d => x(d.value))
.y(d => y(d.density))
function makeCurve(mu, sm) {
var values = jStat(-3, 3, 210)[0],
arr = [];
for (var i in values) {
arr.push({
value: values[i],
density: jStat.normal.pdf(values[i], mu, sm)
})
}
return arr;
}
const svg = d3.select("#cover")
.append("svg").attr("width", w).attr("height", h)
const fill = svg.append("g")
.style("fill", "red")
.style("fill-opacity", 0.5)
.style("stroke", "none")
const curve = svg.append("path").attr("id", "curve")
.attr("d", line(makeCurve(0, 1)))
.style("fill", "none")
.style("stroke", "var(--text-color)")
.style("stroke-width", 4)
var len = curve.node().getTotalLength()
curve
.style("stroke-dasharray", [len, len])
.style("stroke-dashoffset", len)
.transition().duration(2000)
.style("stroke-dashoffset", 0)
const defs = svg.append("defs")
const mask = defs.append("mask").attr("id", "mask")
mask.append("rect")
.attr("width", w)
.attr("height", h)
.style("fill", "white")
mask.append("rect")
.attr("x", x(-3))
.attr("width", x(3) - x(-3))
.attr("height", h)
.style("fill", "black")
.transition().duration(2000).delay(2000)
.attr("x", x(-2))
.attr("width", x(2) - x(-2))
fill.append("path")
.attr("d", line(makeCurve(0, 1)))
.attr("mask", "url(#mask)")
}