2853_es-ES
Intervalos de confianza utilizando una distribución binomialNecesito calcular intervalos de confianza del 95 % para la fracción notificada de eventos adversos en diferentes intervalos de tiempo. Me gustaría utilizar el "intervalo de confianza binomial exacto".
El siguiente enlace muestra cómo hacerlo usando Excel; ¿Existe una forma comparable de hacer esto en JSL?
http://www.itl.nist.gov/div898/handbook/prc/section2/prc241.htm
¡Gracias!Re: Intervalos de confianza usando una distribución binomialAdj Wald es ideal para muestras de tamaño pequeño y converge con la mayoría de los otros métodos con muestras grandes. Tengo un par de artículos *escaneados* que lo analizan, pero una búsqueda rápida en Google tiene algunos detalles al respecto:
http://www.measuringusability.com/wald.htmRe: Intervalos de confianza usando una distribución binomial> +1 en eso. Personalmente, soy fanático de Ajustado Wald.
De los documentos de JMP:
La opción Intervalos de confianza genera la tabla Puntuación de intervalos de confianza, como la que se muestra aquí. Se recomienda el intervalo de confianza de la puntuación porque tiende a tener mejores probabilidades de cobertura (1 - α), especialmente con tamaños de muestra más pequeños (Agresti y Coull 1998).
No estoy seguro si es lo mismo que los cálculos de Wald ajustados. ¡Debería volver atrás y leer las referencias que enumeré! La primera referencia tiene algunos gráficos muy interesantes que muestran la cobertura real.
MiguelRe: Intervalos de confianza usando una distribución binomialBien, aquí están las fórmulas de límite superior e inferior para un intervalo de confianza bilateral:
style="font-size: 10pt; font-family: "Courier New"; color: negro;">Pu
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">=
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
(
style="font-size: 10pt; font-family: "Courier New"; color: verde azulado;">1
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">+
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
(
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">:
style="font-size: 10pt; font-family: "Courier New"; color: negro;">Total
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">-
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">:
style="font-size: 10pt; font-family: "Courier New"; color: negro;">Error )
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">/
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
((
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">:
style="font-size: 10pt; font-family: "Courier New"; color: negro;">Error
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">+
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: verde azulado;">1
style="font-size: 10pt; font-family: "Courier New"; color: negro;">)
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">*
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 221);">F
Cuantil
style="font-size: 10pt; font-family: "Courier New"; color: negro;">(
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
style="font-size: 10pt; font-family: "Courier New"; color: verde azulado;">1
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">-
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">:
style="font-size: 10pt; font-family: "Courier New"; color: negro;">alfa
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">/
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: verde azulado;">2
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">,
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
style="font-size: 10pt; font-family: "Courier New"; color: verde azulado;">2
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">*
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
(
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">:
style="font-size: 10pt; font-family: "Courier New"; color: negro;">Error
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">+
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: verde azulado;">1
style="font-size: 10pt; font-family: "Courier New"; color: negro;">)
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">,
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
style="font-size: 10pt; font-family: "Courier New"; color: verde azulado;">2
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">*
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
(
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">:
style="font-size: 10pt; font-family: "Courier New"; color: negro;">Total
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">-
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">:
style="font-size: 10pt; font-family: "Courier New"; color: negro;">Error )
style="font-size: 10pt; font-family: "Courier New"; color: negro;">)))
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">^
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
(
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">-
style="font-size: 10pt; font-family: "Courier New"; color: verde azulado;">1
style="font-size: 10pt; font-family: "Courier New"; color: negro;">)
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">;
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">Pl
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">=
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
(
style="font-size: 10pt; font-family: "Courier New"; color: verde azulado;">1
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">+
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
((
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">:
style="font-size: 10pt; font-family: "Courier New"; color: negro;">Total
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">-
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">:
style="font-size: 10pt; font-family: "Courier New"; color: negro;">Error
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">+
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: verde azulado;">1
style="font-size: 10pt; font-family: "Courier New"; color: negro;">)
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">/
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">:
style="font-size: 10pt; font-family: "Courier New"; color: negro;">Error )
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">*
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
(
style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 221);">F
Cuantil
style="font-size: 10pt; font-family: "Courier New"; color: negro;">(
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
style="font-size: 10pt; font-family: "Courier New"; color: verde azulado;">1
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">-
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">:
style="font-size: 10pt; font-family: "Courier New"; color: negro;">alfa
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">/
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: verde azulado;">2
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">,
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
style="font-size: 10pt; font-family: "Courier New"; color: verde azulado;">2
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">*
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
(
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">:
style="font-size: 10pt; font-family: "Courier New"; color: negro;">Total
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">-
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">:
style="font-size: 10pt; font-family: "Courier New"; color: negro;">Error
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">+
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: verde azulado;">1
style="font-size: 10pt; font-family: "Courier New"; color: negro;">)
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">,
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
style="font-size: 10pt; font-family: "Courier New"; color: verde azulado;">2
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">*
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">:
style="font-size: 10pt; font-family: "Courier New"; color: negro;">Error
style="font-size: 10pt; font-family: "Courier New"; color: negro;">)))
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">^
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
(
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">-
style="font-size: 10pt; font-family: "Courier New"; color: verde azulado;">1
style="font-size: 10pt; font-family: "Courier New"; color: negro;">)
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">;
Nota: Cuando :Fail = 0 el límite inferior se define como 0. Cuando :Fail = 1 el límite superior se define como 1. Es necesario definir condicionalmente las fórmulas de dos columnas.
El mensaje fue editado por: mpbRe: Intervalos de confianza usando una distribución binomial+1 en eso. Personalmente, soy fanático de Ajustado Wald.Re: Intervalos de confianza usando una distribución binomialLa fórmula de Chadd y su contraparte de límite inferior deben dar los mismos límites superior e inferior que el método del manual nist. Buscaré el otro enlace si estás interesado. Eso no requeriría ningún tipo de codificación, excepto para crear las fórmulas de las columnas.
Quizás valga la pena mencionar que el cálculo "exacto" no necesariamente se considera "mejor" en el sentido de que el intervalo resultante puede ser innecesariamente amplio. Aquí hay un par de artículos en formato PDF que están disponibles y que pueden resultarle interesantes.
http://projecteuclid.org/DPubS/Repository/1.0/Disseminate?view=body&id=pdf_1&handle=euclid.ss/1009213286
http://www.stat.iastate.edu/preprint/articles/2002-05.pdfRe: Intervalos de confianza usando una distribución binomialDescubrí una manera de hacerlo que podría ser más rápida que usar el
función no lineal. Se necesitan entre 12 y 18 intentos seguidos.
antes de encontrar un valor aceptable. Ajustar
el parámetro épsilon para obtener mayor o menor precisión.
¡Tarda menos de un segundo en una tabla de 2400 valores!
Esto fue escrito en JMP 9 por cierto.
style="font-size: 10pt; font-family: "Courier New"; color: verde;">/*
style="font-size: 10pt; font-family: "Courier New"; color: verde;">Binomio
Intervalos de confianza
style="font-size: 10pt; font-family: "Courier New"; color: verde;">
style="font-size: 10pt; font-family: "Courier New"; color: verde;">Buscar
para superior e inferior
intervalos de confianza:
style="font-size: 10pt; font-family: "Courier New"; color: verde;">
style="font-size: 10pt; font-family: "Courier New"; color: verde;">.05
y .95
style="font-size: 10pt; font-family: "Courier New"; color: verde;">
style="font-size: 10pt; font-family: "Courier New"; color: verde;">
style="font-size: 10pt; font-family: "Courier New"; color: verde;">Usos
una tabla con columnas llamada:
style="font-size: 10pt; font-family: "Courier New"; color: verde;">
style="font-size: 10pt; font-family: "Courier New"; color: verde;">Caso
Contar
número de casos para esto
Término preferido
style="font-size: 10pt; font-family: "Courier New"; color: verde;">Total
Casos
número total de casos
style="font-size: 10pt; font-family: "Courier New"; color: verde;">
style="font-size: 10pt; font-family: "Courier New"; color: verde;">
style="font-size: 10pt; font-family: "Courier New"; color: verde;">Agregar
Dos columnas:
style="font-size: 10pt; font-family: "Courier New"; color: verde;">
style="font-size: 10pt; font-family: "Courier New"; color: verde;">Inferior
Límite de CI
style="font-size: 10pt; font-family: "Courier New"; color: verde;">Superior
Límite de CI
style="font-size: 10pt; font-family: "Courier New"; color: verde;">*/
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">dt
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">=
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 221);">actual
tabla de datos
style="font-size: 10pt; font-family: "Courier New"; color: negro;">()
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">;
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">dt
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;"><<
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 221);">nuevo
columna
style="font-size: 10pt; font-family: "Courier New"; color: negro;">(
style="font-size: 10pt; font-family: "Courier New"; color: morado;">"Inferior
CI
Límite"
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">,
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
numérico
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">,
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
Continuo
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">,
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 221);">Formato
style="font-size: 10pt; font-family: "Courier New"; color: negro;">(
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: morado;">"Porcentaje"
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">,
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: verde azulado;">10
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">,
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: verde azulado;">2
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
)
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">,
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo=""> fórmula (
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
iteraciones_max
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">=
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: verde azulado;">100
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">;
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
épsilon
estilo="">
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">=
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: verde azulado;">.0001
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">;
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
límite inferior
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">=
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: verde azulado;">.0000000001
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">;
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
limite superior
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">=
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: verde azulado;">.9999999999
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">;
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
objetivo
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">=
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: verde azulado;">.95
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">;
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
style="font-size: 10pt; font-family: "Courier New"; color: verde;">//
Intervalo de confianza superior
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 221);">para
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
( i
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">=
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: verde azulado;">1
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">,
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
i
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;"><=
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
iteraciones_max
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">,
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
i
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">++,
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
prueba_b1
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">=
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
( límite inferior
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">+
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
limite superior )
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">/
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: verde azulado;">2
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">;
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
bd
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">=
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 221);">binomial
distribución
style="font-size: 10pt; font-family: "Courier New"; color: negro;">(
style="font-size: 10pt; font-family: "Courier New"; color: negro;">test_b1
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">,
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">:
style="font-size: 10pt; font-family: "Courier New"; color: negro;">Total
Casos
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">,
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">:
style="font-size: 10pt; font-family: "Courier New"; color: negro;">Estuche
Contar )
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">;
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 221);">if
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
((
style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 221);">abs
style="font-size: 10pt; font-family: "Courier New"; color: negro;">(
style="font-size: 10pt; font-family: "Courier New"; color: negro;">bd
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">-
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
objetivo )
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;"><=
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
épsilon )
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">,
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 221);">break
style="font-size: 10pt; font-family: "Courier New"; color: negro;">()
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">;
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
)
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">;
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 221);">if
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
( bd
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;"><
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
objetivo
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">,
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
style="font-size: 10pt; font-family: "Courier New"; color: verde;">//
entonces
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
limite superior
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">=
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
prueba_b1
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">;
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
style="font-size: 10pt; font-family: "Courier New"; color: verde;">//
demás
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">,
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
límite inferior
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">=
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
prueba_b1
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">;
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
)
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">;
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
)
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">;
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
prueba_b1
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">;
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo=""> )
estilo="">
style="font-size: 10pt; font-family: "Courier New"; color: verde;">//
fórmula
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">)
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">;
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
style="font-size: 10pt; font-family: "Courier New"; color: verde;">//
finalizar nueva columna
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">dt
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;"><<
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 221);">nuevo
columna
style="font-size: 10pt; font-family: "Courier New"; color: negro;">(
style="font-size: 10pt; font-family: "Courier New"; color: morado;">"Superior
CI
Límite"
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">,
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
numérico
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">,
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
Continuo
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">,
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 221);">Formato
style="font-size: 10pt; font-family: "Courier New"; color: negro;">(
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: morado;">"Porcentaje"
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">,
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: verde azulado;">10
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">,
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: verde azulado;">2
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
)
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">,
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo=""> fórmula (
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
iteraciones_max
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">=
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: verde azulado;">100
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">;
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
épsilon
estilo="">
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">=
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: verde azulado;">.0001
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">;
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
límite inferior
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">=
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: verde azulado;">.0000000001
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">;
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
limite superior
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">=
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: verde azulado;">.9999999999
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">;
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
objetivo
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">=
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: verde azulado;">.05
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">;
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
style="font-size: 10pt; font-family: "Courier New"; color: verde;">//
Intervalo de confianza superior
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 221);">para
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
( i
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">=
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: verde azulado;">1
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">,
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
i
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;"><=
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
iteraciones_max
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">,
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
i
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">++,
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
prueba_b0
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">=
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
( límite inferior
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">+
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
limite superior )
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">/
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: verde azulado;">2
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">;
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
bd
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">=
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 221);">binomial
distribución
style="font-size: 10pt; font-family: "Courier New"; color: negro;">(
style="font-size: 10pt; font-family: "Courier New"; color: negro;">test_b0
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">,
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">:
style="font-size: 10pt; font-family: "Courier New"; color: negro;">Total
Casos
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">,
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">:
style="font-size: 10pt; font-family: "Courier New"; color: negro;">Estuche
Contar )
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">;
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 221);">if
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
((
style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 221);">abs
style="font-size: 10pt; font-family: "Courier New"; color: negro;">(
style="font-size: 10pt; font-family: "Courier New"; color: negro;">bd
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">-
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
objetivo )
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;"><=
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
épsilon )
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">,
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 221);">break
style="font-size: 10pt; font-family: "Courier New"; color: negro;">()
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">;
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
)
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">;
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 221);">if
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
( bd
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;"><
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
objetivo
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">,
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
style="font-size: 10pt; font-family: "Courier New"; color: verde;">//
entonces
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
limite superior
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">=
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
prueba_b0
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">;
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
style="font-size: 10pt; font-family: "Courier New"; color: verde;">//
demás
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">,
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
límite inferior
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">=
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
prueba_b0
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">;
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
)
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">;
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
)
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">;
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
prueba_b0
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">;
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo=""> )
estilo="">
style="font-size: 10pt; font-family: "Courier New"; color: verde;">//
fórmula
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">)
style="font-size: 10pt; font-family: "Courier New"; color: azul marino;">;
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
estilo="">
style="font-size: 10pt; font-family: "Courier New"; color: verde;">//
finalizar nueva columna
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
style="font-size: 10pt; font-family: "Courier New"; color: negro;">
¡Gracias de nuevo por las sugerencias y ayuda de todos!Re: Intervalos de confianza usando una distribución binomialSí, lo intenté, funcionó pero temblaba un poco. No guardé el script pero el principio era algo como esto:
Utilicé un script que excluía todas las filas, luego un bucle for donde cada iteración elimina la fila actual, ejecuta el script no lineal (incluido guardar el valor del parámetro) y finalmente vuelve a excluir la fila actual. Sin embargo, a veces obtuve resultados erróneos probablemente porque la finalización de exclusión/desexclusión de filas se ejecutaba antes de completar el ajuste numérico no lineal. Se podría intentar encontrar el punto óptimo utilizando los comandos Wait() o utilizar alguna otra forma de forzar la finalización.
Otra posibilidad sería ejecutar el método no lineal con un argumento secundario utilizando una columna con una identificación única para cada fila. y luego recorrer los diferentes objetos no lineales para terminar y obtener estimaciones:
Algo como
Re: Intervalos de confianza usando una distribución binomialMS, ¿hay alguna manera de generalizar su solución para una tabla llena de
¿valores?Por ejemplo:
style="font-family: Courier New,Courier,monospace; font-weight: negrita; text-decoration: underline;">Preferido
Término
Conteo Total
Fracción
style="font-family: Courier Nuevo,Courier,monospace;">
style="font-family: Courier New,Courier,monospace;">Dolor de cabeza
18
513 3,5%
style="font-family: Courier Nuevo,Courier,monospace;">
style="font-family: Courier New,Courier,monospace;">Náuseas
24
513 4,7%
style="font-family: Courier Nuevo,Courier,monospace;">
style="font-family: Courier New,Courier,monospace;">Mareos 14
513 2,7%
style="font-family: Courier Nuevo,Courier,monospace;">
style="font-family: Courier Nuevo,Courier,monospace;">.
etc.
De su solución se desprende que necesitaría crear una cuenta separada
tabla de una fila para cada fila
para calcular los límites de confianza.
Saludos,
PedroRe: Intervalos de confianza usando una distribución binomialGracias a todos por sus respuestas o comentarios. MS, su solución funcionó cuando saqué la sección Nuevo script y la ejecuté por separado (en JMP 8.0.2 y 9.0.0).Re: Intervalos de confianza usando una distribución binomialA continuación se muestra un ejemplo del enfoque no lineal. El siguiente script crea una tabla de datos con los mismos datos que en el ejemplo de Excel. Ejecute el script de la tabla para calcular los límites de confianza.
(Primero probé una solución clara que incluía la plataforma no lineal (de forma invisible) en una fórmula de columna para permitir el cálculo automático. Funcionó, pero no siempre, ya que JMP a veces se quedaba atrapado dentro de un bucle aparentemente infinito).
Re: Intervalos de confianza usando una distribución binomialHay un par de formas de imitar el ejemplo de Excel directamente utilizando la función de distribución binomial de JMP. Una forma es crear una columna con esa fórmula y otras columnas para las variables independientes y usar Profiler para lograr el lado derecho objetivo variando la proporción p. La otra forma es configurarlo como un ajuste no lineal usando p nuevamente para lograr el lado derecho objetivo. Ambos trabajan.Re: Intervalos de confianza usando una distribución binomialParece que se está utilizando Clopper-Pearson Exact CI. Esto es lo que he usado para calcular el intervalo de confianza superior para alfa. Desafortunadamente, la teoría sobre cómo se derivó se ha borrado de mi memoria.
Límite superior exacto de Clopper Pearson
(1 + (:Total - :Fallo) / ((:Fallo + 1) * F Cuantil(
1 - :alfa,
2 * (: Fallo + 1),
2 * (:Total - :Fallo)
))) ^ (-1)
Comments
There are no comments yet