感謝您使用此腳本,它有很多幫助。我不知道你可以在JMP中編寫腳本。
約翰尼
這樣做的方法是簡單地創建一個新列並使用一個相當簡單的公式來創建二進製文件。 這是一個執行所需操作的腳本,但您可以通過創建新列然後使用公式編輯器為公式創建代碼,以交互方式輕鬆創建此腳本。
Names Default To Here( 1 );
// Create an example data table
dt = New Table( "Bin",
add rows( 60000 ),
New Column( "value", numeric, formula( Random Normal( 1500, 600 ) ) )
);
// Make sure all 60,000 get processed before proceeding
wait(2);
// Remove the formula to make the values "real" not virtual values
dt:value << delete property( "formula" );
// Create a new column with a binning formula you want
dt << New Column( "Bin",
character,
formula(
If(
:value < 250, "<250",
:value < 500, "250-499",
:value > 3000, ">3000",
Char( 500 * Floor( :value / 500 ) ) || "-" || Char(
500 * Ceiling( :value / 500 ) - 1
)
)
)
);
// Since the bin values will not display alphabetically, set the Value Ordering
// column property to make sure the ordering will display properly
dt:bin << set property(
"value ordering",
{"<250", "250-499", "500-999", "1000-1499", "1500-1999", "2000-2499", "2500-2999", ">3000"}
);
PS
我相信你會發現你的評論“ 如果可能的話,任何想法如何做到這一點?“將成為一個非問題,或者至少它將被修改為問題的第一部分,”任何想法如何做到這一點?“。 使用JMP和JSL可以找到或創建您需要的任何內容。