Realizo investigaciones dentro del campo agrícola y utilizo Excel como la mayoría de las personas para organizar mis datos. Sin embargo, un análisis común es el área bajo la curva de progreso de la enfermedad (AUDPC) para rastrear los cambios de la enfermedad a lo largo de la temporada de crecimiento. ¿Hay alguna forma de calcular el área total debajo de un gráfico de líneas sin ajustar una línea de tendencia / análisis de regresión?
Hola,
La única forma de lograrlo es calculando el área poligonal definida por sus puntos de datos y el piso del gráfico.
area = Polygon Area( {0, 0}, {0, 10}, {10, 10}, {10, 0} );
NOTA: 1) puede utilizar esta función en una fórmula. 2) Es fundamental incluir los orígenes del polígono como se muestra en el ejemplo simple anterior.
Mejor,
TS
Thierry,
Gracias por la respuesta. ¿Supongo que la fórmula que publicó se aplicará dentro del software de Excel? ¿O hay un método para usar esto dentro del software JMP?
Mejor,
La fórmula publicada es para JMP en lugar de Excel. Sobre la base de la respuesta de @Thierry_S puede hacer este tipo de cosas en JSL, el lenguaje de scripting para JMP:
NamesDefaultToHere(1);
// Some simple data
dt =
New Table( "AUDPC Example",
Add Rows( 4 ),
New Column( "x", Numeric, "Continuous", Set Values( [0, 1, 2, 3] )),
New Column( "y", Numeric, "Continuous", Set Values( [3, 4, 4.5, 5] ))
);
// A graph
gb = dt << Graph Builder(
Size( 526, 454 ),
Show Control Panel( 0 ),
Show Legend( 0 ),
Variables( X( :x ), Y( :y ) ),
Elements( Line( X, Y, Legend( 5 ) ) ),
SendToReport(
Dispatch(
{},
"x",
ScaleBox,
{Min( -1 ), Max( 4 ), Inc( 0.5 ), Minor Ticks( 0 ),
Add Ref Line( 0, "Dashed", "Red", "", 1 ),
Add Ref Line( 3, "Dashed", "Red", "", 1 )}
),
Dispatch(
{},
"y",
ScaleBox,
{Format( "Best", 12 ), Min( -1 ), Max( 6 ), Inc( 1 ), Minor Ticks( 1 ),
Add Ref Line( 0, "Dashed", "Red", "", 1 ),
Add Ref Line( 1, "Dashed", "Red", "", 1 )}
)
)
);
// Start here . . .
dt = CurrentDataTable();
// Get the x and y values
xVals = Column(dt, "x") << getValues;
yVals = Column(dt, "y") << getValues;
// Insert two points that define the base of the polygon at the value y = 0
baseLine = [0];
xVals2 = VConcat(xVals[1], xVals, xVals[NRow(xVals)]);
yVals2 = VConcat(baseLine, yVals, baseline);
// Get the area
a2 = PolygonArea(xVals2, yVals2);
Print(a2);
// Insert two points that define the base of the polygon at the value y = 1
baseLine = [1];
xVals3 = VConcat(xVals[1], xVals, xVals[NRow(xVals)]);
yVals3 = VConcat(baseLine, yVals, baseline);
// Get the area
a3 = PolygonArea(xVals3, yVals3);
Print(a3);
Haga 'Archivo> Nuevo> Nuevo script', corte y pegue el código de arriba en la ventana que aparece, luego haga 'Editar> Ejecutar script'. Entiendo que es posible que no desee aprender JSL. Tenga en cuenta que esto da el área 'debajo' del polígono definido por los valores de datos. Puede que desee o no el área bajo algún tipo de curva ajustada, pero esto también es posible.