Col分位計算で行を除外するやあ、
Col Quantile(:height、0.5、:class)を取得しようとしましたが、計算では除外された行が考慮されているようです。
除外された行をColQuantile計算に拒否する方法はありますか?
ありがとう、
みどり
スクリプティングRe:列分位計算で行を除外するCol Quantile()関数内で除外されている行を確認できます。以下は例です
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << New Column( "Col Quantile Height by Age",
numeric,
continuous,
formula( Col Quantile(If(excluded(rowstate(Row())),., :height), 0.5, :age ) )
);
除外された行の状態がデータテーブルの行で変更されるたびに、数式は新しい値を計算します
Re: 列分位数の計算で行を除外する次のコードを使用して、多くのパラメーターの 50 パーセンタイルを収集するループを作成しようとしましたが、「test_list」の両方の要素は同じです (どちらも重みの 50% です)。ただし、行を手動で実行すると機能します。 for ループ内で Col Quantile() 関数を使用することはできませんか?
名前のデフォルトは Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
プロットパラメータ={
身長、
重さ};
テストリスト={};
for(plotcnt=1、plotcnt<=nitems(plot_param)、plotcnt++、
pct_50=Col Quantile( If(excluded(rowstate(Row())),., column(plot_param[plotcnt])), 0.5);
test_list[plotcnt]=pct_50;
);
Re: 列分位数の計算で行を除外する
次のコードを使用して、多くのパラメーターの 50 パーセンタイルを収集するループを作成しようとしましたが、「test_list」の両方の要素は同じです (どちらも重みの 50% です)。ただし、行を手動で実行すると機能します。 for ループ内で Col Quantile() 関数を使用することはできませんか?
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
plot_param={
height,
weight};
test_list={};
for(plotcnt=1, plotcnt<=nitems(plot_param), plotcnt++,
pct_50=Col Quantile( If(excluded(rowstate(Row())),., column(plot_param[plotcnt])), 0.5);
test_list[plotcnt]=pct_50;
); Re: 列分位計算で行を除外するNames Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
plot_param={
height,
weight};
test_list={};
for(plotcnt=1, plotcnt<=nitems(plot_param), plotcnt++,
Eval (Substitute (Expr(pct_50=Col Quantile( If(excluded(rowstate(Row())),., _col_), 0.5)), Expr(_col_), column(plot_param[plotcnt])));
test_list[plotcnt]=pct_50;
);
Re: 列分位計算で行を除外するタイプミスのため、1 を 1 で置き換えても、Eval (substitute()) で十分であることに気付きました。
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
plot_param = {height, weight};
test_list = {};
For( plotcnt = 1, plotcnt <= N Items( plot_param ), plotcnt++,
pct_50 = Eval( Substitute( Expr( Col Quantile( If( Excluded( Row State( Row() ) ), ., Column( plot_param[plotcnt] ) ), 0.5 ) ), 1, 1 ) );
test_list[plotcnt] = pct_50;
);
show(test_list);

Re: 列分位計算で行を除外する@LatentDataTiger 、JMP サポートからのフィードバック (TS-00139301)
はい、これはバグです。開発者は、特に Col Quantile [および Col Median] のキャッシュの問題であることを確認しました。他の Col 関数にはこの問題はありません。Substitute を使用すると、ループの反復ごとに新しい式が作成され、キャッシュが不適切に使用されなくなります。ご報告いただきありがとうございます。バグ レポートを提出します。
したがって、その行の下では、バグを修正するのはSubstituteではなく、 Eval(Expr())による保護です。
効果を示す@Arn_Cotaの素晴らしい例 [改変版]:
もっと見る...Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
plot_param = {height, weight};
test_list = {};
For( plotcnt = 1, plotcnt <= N Items( plot_param ), plotcnt++,
// Without Exclude, returns correct values
pct_50_v0 = Col Quantile( Column( plot_param[plotcnt] ), 0.5 );
// With Exclude, returns the Quantile for height
pct_50_v1 = Col Quantile(
If( Excluded( Row State( Row() ) ),
.,
Column( plot_param[plotcnt] )
),
0.5
);
// With Eval and Substitute, returns correct values
pct_50_v2 = Eval(
Substitute(
Expr(
Col Quantile(
If( Excluded( Row State( Row() ) ),
.,
Column( plot_param[plotcnt] )
),
0.5
)
),
1, 1
)
);
// use Eval(Expr() to protect the expression against inappropriate caching
pct_50_v3 = Eval(Expr(Col Quantile(
If( Excluded( Row State( Row() ) ),
.,
Column( plot_param[plotcnt] )
),
0.5
)));
// Show different versions
Show(
plotcnt,
Column( plot_param[plotcnt] ),
pct_50_v0,
pct_50_v1,
pct_50_v2,
pct_50_v3
);
test_list[plotcnt] = pct_50_v3;
); Re: 列分位計算で行を除外するJMP の式処理に例/回避策が追加されました: Tipps と Trapdoors