如何將變量用於自定義分位數親愛的社區,
我已經苦苦掙扎了一段時間,尋找一種用Application中的變量替換下面的硬編碼值0.95和0.99的方法。
Continuous Distribution(
Column( Eval( colSelect ) ),
Horizontal Layout( 0 ),
Histogram( 0 ),
Vertical( 0 ),
Std Error Bars( 1 ),
Count Axis( 1 ),
Show Percents( 1 ),
Show Counts( 1 ),
Axes on Left( 1 ),
Outlier Box Plot( 0 ),
Set Bin Width( 1 ),
Custom Quantiles( <FONT color="#339966"><STRONG>0.95, [0.95, 0.99]</STRONG></FONT> ),
<EM>// Custom Quantiles( <FONT color="#FF0000">( Eval( Percent1 ) /100 ), [( Eval( Percent1 ) /100 ), ( Eval( Percent2 ) /100 )]</FONT> ),</EM> Customize Summary Statistics(
Std Err Mean( 0 ),
Upper Mean Confidence Interval( 0 ),
Lower Mean Confidence Interval( 0 ),
Minimum( 1 ),
Maximum( 1 )
)
),
該對話框腳本帶有一組自定義變量,包括要分析的列(“ colSelect”)以及兩個百分位數值,它們都可以很好地檢索到(Show(),在同一腳本的前面):
dt = DataTable("Dep0Times_Overall_IST5000");<BR />colSelect = "Total Time From Entrance Queue To First Pre-Sortation";<BR />Percent1 = 95;
Percent2 = 99;無論我是否使用Eval()方法嘗試上面的紅線,我都會在下面得到同樣令人討厭的錯誤:
Invalid matrix token.
Line 50 Column 49: ...val( Percent1 ) /100 ), [►( Eval( Percent1 ) /100 )...
謝謝!
腳本編寫回复:如何將變量用於自定義分位數百分比值是矩陣中的元素,如果在分發之前創建矩陣,則使用它是一種簡單的替代。
Names Default To Here( 1 );
dt = open("$SAMPLE_DATA/big class.jmp");
colSelect = "height";
percent1 = .95;
percent2 = .99;
perMatrix = Matrix( percent1 ) || Matrix( percent2 );
distribution(
Continuous Distribution(
Column( Eval( colSelect ) ),
Horizontal Layout( 0 ),
Histogram( 0 ),
Vertical( 0 ),
Std Error Bars( 1 ),
Count Axis( 1 ),
Show Percents( 1 ),
Show Counts( 1 ),
Axes on Left( 1 ),
Outlier Box Plot( 0 ),
Set Bin Width( 1 ),
Custom Quantiles( Percent1, perMatrix ),
// Custom Quantiles( ( Eval( Percent1 ) /100 ), [( Eval( Percent1 ) /100 ), ( Eval( Percent2 ) /100 )] ), Customize Summary Statistics(
Std Err Mean( 0 ),
Upper Mean Confidence Interval( 0 ),
Lower Mean Confidence Interval( 0 ),
Minimum( 1 ),
Maximum( 1 )
)
);回复:如何將變量用於自定義分位數吉姆和所有人,
終於可以了(也許不是最優雅的語法)
Percent1 = 95;<BR />Percent2 = 99;<BR />percentMatrix = <FONT color="#008000">Matrix( {{ Percent1 /100 }, { Percent2 /100 }} )</FONT>;<BR />percentMatrix = [<FONT color="#008000">0.95, 0.99</FONT>];<BR />...<BR /> Custom Quantiles( ( Percent1 /100 ), percentMatrix ),<BR />代替:
percentMatrix = <FONT color="#FF6600">Matrix( Percent1 /100 ) || Matrix( Percent2 /100 )</FONT>;<BR />percentMatrix = [<FONT color="#008000">0.95</FONT> <FONT color="#FF6600">0.99</FONT>]
乾杯!