アンケートの質問に対して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 さん、あなたがどれだけ時間を節約してくれたのか見当もつきませんね。ありがとうございます、先生!