Power of a hypothesis test
Date: 31 October 2013

Separación vertical

μ bajo H_1

Error tipo 2: %v

μ_0

Área 2

Área 1

α =

¡Pulsa el botón para que se mueva!

Error tipo 1: α

Diferencia: μ - μ_0 = 

Difference: μ - μ_0  =

Mostrar distribución bajo H_1

Mostrar potencia

Mostrar región error tipo 2

número de veces que se ha cambiado el valor de mu1

¡Arrástrame!

\overline{X}

\overline{X}

%v

Rechazar H_0

Rechazar H_0

Licencia: https://creativecommons.org/licenses/by-sa/3.0/
Traducido a partir de http://melbapplets.ms.unimelb.edu.au

σ_x = 1 (slider from 0.2 to 2, step 0.2)
n = 30 (slider from 10 to 50, step 1)
sigma0: σ_x / sqrt(n)
sigma1: sigma0
offsetSlider = -3 (slider from -3 to 0, step 0.15)
offset: offsetSlider
baseline(x) = offset
mu1Point = Point(baseline)
rightBound: x(Corner[3])
mu1: x(mu1Point)
f(x) = exp((-((x - mu1) / sigma1)^(2)) / 2) / (sqrt(2 * π) * abs(sigma1)) + offset
mu0 = 0
alpha = 0.05
leftBound: x(Corner[1])
nullRightThreshold = InverseNormal(mu0, sigma0, 1 - alpha / 2)
nullLeftThreshold = InverseNormal(mu0, sigma0, alpha / 2)
nullDist(x) = exp((-((x - mu0) / sigma0)^(2)) / 2) / (sqrt(2 * π) * abs(sigma0))
leftThresholdLine = Segment((nullLeftThreshold, nullDist(nullLeftThreshold)), (nullLeftThreshold, 0))
rightThresholdLine = Segment((nullRightThreshold, nullDist(nullRightThreshold)), (nullRightThreshold, 0))
T2Region = IntegralBetween(f, baseline, nullLeftThreshold, nullRightThreshold)
leftPowerRegion = IntegralBetween(f, baseline, Min[leftBound, mu1 - 4 * sigma1], nullLeftThreshold)
rightPowerRegion = IntegralBetween(f, baseline, nullRightThreshold, Max[rightBound, mu1 + 4 * sigma1])
power: leftPowerRegion + rightPowerRegion
alphaInputBox = Textfield(alpha)
t1lefttail = IntegralBetween(nullDist, 0, leftBound, nullLeftThreshold)
t1righttail = IntegralBetween(nullDist, 0, nullRightThreshold, rightBound)
T2 = 0
difference = 0.19614153182599092
differenceInputBox = Textfield(difference)
showAltDist = true
showPower = true
showT2Error = false
leftThresholdLine2 = Segment((nullLeftThreshold, 0), (nullLeftThreshold, offset))
rightThresholdLine2 = Segment((nullRightThreshold, 0), (nullRightThreshold, offset))
actionCount = 5
powerLabelX: mu1
mu0Guideline = Segment((mu0, 0), (mu0, offset))
differenceLabel: "" + difference + ""
differenceLine = Vector((mu0, offset - 0.3), (mu1, offset - 0.3))
differenceLineLeftEnd = Segment((mu0, offset - 0.27), (mu0, offset - 0.33))
differenceLineRightEnd = Segment((mu1, offset - 0.27), (mu1, offset - 0.33))
leftRejectLine = Segment((nullLeftThreshold, nullDist(nullLeftThreshold)), (nullLeftThreshold, 1.8))
rightRejectLine = Segment((nullRightThreshold, nullDist(nullRightThreshold)), (nullRightThreshold, 1.8))
leftRejectArrow = Vector((nullLeftThreshold, 1.65), (nullLeftThreshold - 0.26, 1.65))
rightRejectArrow = Vector((nullRightThreshold, 1.65), (nullRightThreshold + 0.26, 1.65))
altOriginMark = Segment((mu0, offset), (mu0, offset - 0.05))
T1ProbText: "Error tipo 1: " + alpha + ""
betaText: "Probabilidad error tipo 2: β = " + T2Region + ""
debug: "contador = " + actionCount + ""
powerLabel: "Potencia: " + power + ""
powerText: "Potencia: Área 1+2 = " + power + ""