JMP 中是否有一種簡單的方法來匯總和導出表中包含的所有值標籤信息(其中多個列可能具有不同的值標籤,但並非所有列都具有值標籤)? 目前通過對帶有值標籤的每一列進行重新編碼,並進行製作數據表來手動執行此操作。 然後我將所有生成的數據表組合在一起得到一個堆疊表(參見下面的示例文件)。
目前,所有值都是數字,值標籤是字符,因此堆疊不是問題。
很高興獲得此答案的交互式和腳本答案,儘管我懷疑它將是腳本。
不確定是否有直接的交互方式來做到這一點,但這裡有一種腳本方式:
Names Default To Here(1);
//dt = Current Data Table();
dt = Open("$SAMPLE_DATA/CrabSatellites.jmp");
colNames = dt << Get Column Names("String");
dt_stack = New Table("Stacked_Value_Labels",
New Column("Values", Numeric, "Continuous", Format("Best", 12), ),
New Column("Labels", Character, "Nominal"),
New Column("Rating", Character, "Nominal")
);
For(i = 1, i <= N Items(colNames), i++,
colProp = Arg(Column(dt, colNames[i]) << Get Value Labels);
If(!IsEmpty(colProp) > 0,
For(k = 1, k <= N Items(colProp), k++,
currentColPropExpr = colProp[k];
dt_stack << Add Rows(
{Values = Arg(currentColPropExpr, 1), Labels = Arg(currentColPropExpr, 2), Rating = colNames[i]}
);
);
);
);