Realicé un análisis de ACV sobre las preguntas de la encuesta. En la sección "estimaciones de parámetros" del informe generado, hay una tabla. Cuando lo exporto, no exporta las celdas combinadas en la parte superior. Por ejemplo:
Grupo 1: [Columna superior: Estado]
[AZ] [VA], [CC], [TX]
Solo exporta el clúster y las estimaciones de parámetros para [AZ] [VA], [DC], [TX]. Quiero exportar todo lo visible, incluida la columna superior con celdas combinadas.
Espero que alguien en la comunidad tenga una solución mejor que la que se me ocurrió. No conozco una forma directa de agregar encabezados extensos a los encabezados de columna en una tabla de datos de salida. Sin embargo, he escrito un script de ejemplo que puede hacer lo que quieras.
Se necesita un resultado del análisis ACV

y genere la tabla Estimaciones de parámetros con los encabezados de expansión precedidos en cada columna

Aquí está el script de ejemplo.
Names Default To Here( 1 );
// Run a LCA
dt = Open( "$SAMPLE_DATA/Car Poll.jmp" );
dt << Latent Class Analysis(
Y( :sex, :marital status, :country, :size, :type ),
Set Random Seed( 12345 ),
Number of Clusters( 3 ),
);
// Create an output table will all header names in each column's name
obj = current report()[OutlineBox(1)];
// Get the number of tiles that span across columns
numSpans = Length( (obj << xpath( "//ColSpanBox" )) );
// Loop across the spanning titles and add the title as a prefix to the column name
For( span = 1, span <= numSpans, span++,
// Get the header
theHeading = obj["Parameter Estimates"][Col Span Box( span )] << get heading;
// Get the column names for the current spanning header
theCols = obj["Parameter Estimates"][Col Span Box( span )] << get text;
// Loop across each column name in the span
subColNum = 1;
While( Try( Word( subColNum, theCols, "\!n\!t\!r" ), "" ) != "",
targetCol = Word( subColNum, theCols, "\!n\!t\!r" );
// Loop across all numeric column and when a match is found change the column name
numCol = 2;
While(
Try( obj["Parameter Estimates"][Number Col Box( numCol )] << get heading, "" )
!= "",
theNumberColBoxHeader = obj["Parameter Estimates"][Number Col Box( numCol )]
<< get heading;
If( targetCol == theNumberColBoxHeader,
obj["Parameter Estimates"][Number Col Box( numCol )] <<
set heading( theHeading || " " || targetCol )
);
numCol++;
);
subColNum++;
);
);
// Create the output data table
obj["Parameter Estimates", Table Box( 1 )] << Make into data table;
Eso es impresionante @txnelson, no tienes idea de cuánto tiempo me has ayudado a ahorrar. Felicitaciones a usted, señor!