설문조사 질문에 대해 LCA 분석을 실시했습니다. 생성된 보고서의 "매개변수 추정" 섹션에 표가 있습니다. 내보낼 때 병합된 셀이 맨 위에 내보내지지 않습니다. 예를 들어:
클러스터 1: [상단 열: 주]
[AZ] [VA], [DC], [TX]
클러스터와 [AZ] [VA], [DC], [TX]에 대한 매개변수 추정만 내보냅니다. 병합된 셀이 있는 상단 열을 포함하여 보이는 모든 항목을 내보내고 싶습니다.
커뮤니티의 누군가가 제가 생각해낸 것보다 더 나은 해결책을 갖고 있기를 바랍니다. 출력 데이터 테이블의 열 헤더에 확장 헤더를 추가하는 직접적인 방법을 모르겠습니다. 그러나 나는 당신이 원하는 것을 할 수 있는 예제 스크립트를 작성했습니다.
LCA 분석 결과가 필요합니다.

각 열 앞에 스패닝 헤더가 붙은 매개변수 추정 테이블을 출력합니다.

다음은 예제 스크립트입니다.
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;
@txnelson 정말 인상적이네요. 여러분이 제가 얼마나 많은 시간을 절약할 수 있도록 도와주셨는지 전혀 모르실 겁니다. 감사합니다 선생님!