Hola a todos,
Estoy intentando resumir varias tablas pero necesito que estén en formato de bucle.
1. ¿Cómo puedo hacer un bucle para que el nombre de la tabla de salida tenga un nombre uniforme (por ejemplo, resumen 1, resumen 2)?
2. ¿Cómo puedo repetir la siguiente tabla de salida para obtener otro resumen?
Por favor ayuda. TIA
- ¿Existe un nombre específico para la necesidad de resumen 1, resumen 2 ... y así sucesivamente?
- Si tiene nombres específicos, puede usarlos, pero lo desaconsejaría y usaría referencias.
Aquí hay un ejemplo con Big Class sobre cómo usar referencias
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
dt_list = dt << Subset(
By(:sex),
All rows,
Selected columns only(0),
columns(:name, :age, :height, :weight)
);
show(dt_list);
//add dt to dt_list
Insert into(dt_list, dt);
show(dt_list);
//create list to collect summary tables
dt_summary_list = {};
//will require JMP16 due to For Each. For Each can be replöaced with for loop
For Each({val, idx}, dt_list,
dt_summary = val << Summary(
output table("Summary " || char(idx)), //we can use output table() to define name
//output table("Summary"), //you could also let jmp take care of naming
Group(:age),
Mean(:height),
Freq("None"),
Weight("None")
);
Insert Into(dt_summary_list, dt_summary);
);
Show(dt_summary_list[2]); //should use list and indices rather than "hardcoded" names
summary_of_summary = Datatable("Summary 2") << Summary(
output table("SummaryOfSummary2"),
Mean(:"Mean(height)"n),
Freq("None"),
Weight("None")
);