2 つの列の UniqueVals の組み合わせで選択および除外するにはどうすればよいですか?それで、私はここで行き詰まっています。 Chart_ID と Recipe_ID の 2 つの列に基づいて、統計的に有意なデータのみのスクリーニングされた dt を出力しようとしています。 1 つの列ではうまく機能しますが、2 つの列についてはわかりません。
- Oneway (y=平均、x=チャンバー、BY:Chart_ID、Recipe_ID) を使用して生データをプロットし、All-pairs Tukey t検定を実行しています。
- 次に、結合された pVal データ テーブルを取得します。
- 次にpVal >0.05の行をすべて選択し、
- 次に、Chart_ID 別に UniqueVals の要約リストを作成します (これは、重要な pVals を持つすべての Chart_ID です)。
- 次に、ソースdt内の一致するUniqueValsを持つすべての行を選択します。
- 次に選択を反転して除外する
- --> これにより、ソース dt には Chart_ID によって tTest 有意なデータのみが残ります。
Recipe_ID を集計 UniqueVals に追加する方法がわかりません。
重要でないチャートやレシピをすべて除外したソース dt を作成するためのより良い方法はありますか?
//dtSPC --> my source data, raw SPC data. Need to exclude rows from Charts, Recipes with high pVals
/*plotting a basic Fit YbyX just to get pValues. Formatting and style done on final plot*/
ow1 = Oneway(
Y( :MEAN ),
X( :CHAMBER ),
By(:CHART_ID, :RECIPE),
//All pairs Tukey HSD test
All Pairs(
1,
Confidence Quantile( 0 ),
Difference Matrix( 0 ),
LSD Threshold Matrix( 0 ),
Connecting Letters Report( 0 ),
Ordered Differences Report( 1 )
),
);
/***********************************/
/***********************************/
// Create the combined data table, using xPath (return a list of the OutlineBoxes from the report that have the title Ordered Differences Report. Then, use the first of those to make the combined data table.)
outlines = (Report( ow1[1] ) << Top Parent) << XPath( "//OutlineBox[text()='Ordered Differences Report']" );
dt1 = outlines[1][Table Box( 1 )] << Make Combined Data Table;
dt1 = current data table();
dt1 << set name( "pValue PairWise by Channel Tukey");
dt1:CHART_ID << Data type( Numeric ) << Set Modeling Type( Nominal );
/***********************************/
/**********************************/
//Screen and show only the CHART_ID's w/ a Tukey pair pVal<0.05
//exclude all high pVal rows, leaving only low pVal Channels. Does not work in reverse.
dt1 << select where(:name("p-Value") > 0.05);
dt1 << exclude;
dt1 << clear select;
//create a list of remaining Unique CHART_ID's
summarize(dt1, uniqueVals=by(:CHART_ID));
//Convert to numeric
For( i = 1, i <= N Items(uniqueVals ), i++,
uniqueVals[i] = Num(uniqueVals[i] )
);
//extra, just to look at the data
//dtUnique = New Table( "uniqueVals less 0.05");
//dtUnique << New Column( "CHART_ID", Values(uniqueVals));
//select on SPC source data just the channels w/ low pVals
//need to choose SPC data table
dtSPC << clear select;
dtSPC << select where( contains( uniqueVals, :CHART_ID));
//invert and exclude, leaving only low pVal CHART_ID's
dtSPC << invert row selection << exclude;
dtSPC << clear select;データのブレンドとクリーンアップRe: 2 つの列の UniqueVals コンボで選択および除外する方法は?それは働いた!そのような単純なWIN。連結された値を文字列に送信します。Re: 2 つの列の UniqueVals コンボで選択および除外する方法は?私の以前の連想配列()ソリューションは、列に重複した値があると正しく機能しません(非常に簡単に修正できます)ので、for-loopバージョンを使用しています。
これはあなたが望むことをしますか?
Names Default To Here(1);
dtPopCorn = Open( "$SAMPLE_DATA/Popcorn.jmp" );
/*plotting a basic Fit YbyX just to get pValues. Formatting and style done on final plot*/
ow1 = Oneway(
Y( :yield ),
X( :batch),
By(:trial, :popcorn),
//All pairs Tukey HSD test
All Pairs(
1,
Confidence Quantile( 0 ),
Difference Matrix( 0 ),
LSD Threshold Matrix( 0 ),
Connecting Letters Report( 0 ),
Ordered Differences Report( 1 )
),
);
/***********************************/
/***********************************/
// Create the combined data table, using xPath (return a list of the OutlineBoxes from the report that have the title Ordered Differences Report. Then, use the first of those to make the combined data table.)
outlines = (Report( ow1[1] ) << Top Parent) << XPath( "//OutlineBox[text()='Ordered Differences Report']" );
dt1 = outlines[1][Table Box( 1 )] << Make Combined Data Table;
dt1 << set name( "pValue PairWise by Channel Tukey");
/***********************************/
/**********************************/
pVals = Loc(dt1:"p-Value"n << get as matrix <= 0.05);
comparisonStrings = {};
For(i = 1, i <= N Items(pVals), i++,
Insert Into(comparisonStrings, char(dt1:trial[pVals[i]]) || dt1:popcorn[pVals[i]]);
);
show(comparisonStrings);
dtPopCorn << clear select;
dtPopCorn << select where(contains(comparisonStrings, char(:trial)||:popcorn));p 値が 0.05 未満の組み合わせのみが、トライアル = 2 およびポップコーン = グルメです。

Re: 2 つの列の UniqueVals コンボで選択および除外する方法は?@jthi
ヒントをありがとう、しかし私はあなたのスクリプトについて少し混乱しています。 選択を数回行っているように見えますが、ソース dt に戻るために何もしません。
結合されたデータ テーブルから pVal を選択できます。 私が抱えている問題は、結合データ テーブルの 2 つの列で要約してから、メイン ソース データに戻り、要約を使用して選択しようとすることです。
この問題について話すのに使えそうなサンプル セットを見つけました。
2 つの BY 列を使用してソース dt に要約する方法がわかりません
By(:試用, :オイル量),
dtPopCorn = Open( "$SAMPLE_DATA/Popcorn.jmp" );
/*plotting a basic Fit YbyX just to get pValues. Formatting and style done on final plot*/
ow1 = Oneway(
Y( :yield ),
X( :popcorn ),
By(:trial, :oil amt),
//All pairs Tukey HSD test
All Pairs(
1,
Confidence Quantile( 0 ),
Difference Matrix( 0 ),
LSD Threshold Matrix( 0 ),
Connecting Letters Report( 0 ),
Ordered Differences Report( 1 )
),
);
/***********************************/
/***********************************/
// Create the combined data table, using xPath (return a list of the OutlineBoxes from the report that have the title Ordered Differences Report. Then, use the first of those to make the combined data table.)
outlines = (Report( ow1[1] ) << Top Parent) << XPath( "//OutlineBox[text()='Ordered Differences Report']" );
dt1 = outlines[1][Table Box( 1 )] << Make Combined Data Table;
dt1 = current data table();
dt1 << set name( "pValue PairWise by Channel Tukey");
dt1:trial << Data type( Numeric ) << Set Modeling Type( Nominal );
/***********************************/
/**********************************/
//Screen and show only the trial's w/ a Tukey pair pVal<0.05
//exclude all high pVal rows, leaving only low pVal Channels. Does not work in reverse.
dt1 << select where(:name("p-Value") > 0.5); //I know...just setting 0.5 so that one row stands out.
dt1 << exclude;
dt1 << clear select;
//create a list of remaining Unique trial's
summarize(dt1, uniqueVals=by(:trial));
//Convert to numeric
For( i = 1, i <= N Items(uniqueVals ), i++,
uniqueVals[i] = Num(uniqueVals[i] )
);
//extra, just to look at the data
//dtUnique = New Table( "uniqueVals less 0.5");
//dtUnique << New Column( "trial", Values(uniqueVals));
//select on SPC source data just the channels w/ low pVals
//need to choose SPC data table
dtPopCorn << clear select;
dtPopCorn << select where( contains( uniqueVals, :trial));
//invert and exclude, leaving only low pVal trial's
dtPopCorn << invert row selection << exclude;
dtPopCorn << clear select;Re: 2 つの列の UniqueVals コンボで選択および除外する方法は?数値列を文字に変換してから、2 つの列を連結して比較文字列のリストを取得できます。 次に、そのリストを使用して必要な行を選択します (または連想配列を使用します)。 サンプル データセットがないため、ここにある種の例を示します。
Names Default To Here(1);
dt = New Table("Untitled 22",
Add Rows(5),
Compress File When Saved(1),
New Column("CHART_ID",
Character,
"Nominal",
Set Values({"123", "1", "12", "0", "135"})
),
New Column("RECIPE",
Character,
"Nominal",
Set Values({"A", "A", "B", "B", "C"})
),
New Column("pval",
Numeric,
"Continuous",
Format("Best", 12),
Set Values([0.1, 0.001, 0.051, 0.002, 0.1])
)
);
pVals = Loc(dt:pval << get as matrix > 0.05); //get rows over 0.05
comparisonStrings = {};
For(i = 1, i <= N Items(pVals), i++,
Insert Into(comparisonStrings, char(dt:CHART_ID[pVals[i]]) || dt:RECIPE[pVals[i]]);
);
wait(1);
dt << Select Where(Contains(comparisonStrings, char(:CHART_ID)||:RECIPE));
wait(1);
dt << clear select;
wait(1);
aa = Associative Array(Eval List(dt:CHART_ID[pVals]), EvalList(dt:RECIPE[pVals]));
dt << Select Where(Contains(aa, :CHART_ID) & aa[:CHART_ID] == :RECIPE);Scripting Index を使用して、何が起こっているかをよりよく理解してください (必要に応じてデバッグすることもできます)。
Re: 2 つの列の UniqueVals コンボで選択および除外する方法は?情報ありがとうございます。 私は ASA の声明を読みましたが、ほとんど意味がありません。 しかし、私の状況 (および他の多くの ppl) は何千ものチャートを扱っており、最も重要なものを確認するためにリストをすばやく選別してトリミングする方法が必要です。 例としてスクリーンショットを示します。 5,000 のグラフを選別する必要があり、最も重要なグラフを特定して時間を費やすのに適した方法が必要です。 どこかで線引きしなきゃ。
FDR も調べましたが、X 特性を 1 つしか使用していないため、これは当てはまらないと思います。 1 つの X だけで FDR が発生することはありません。

選択と要約について:
それが問題です。 要約を取得してから、ソース データを選択できるように変換する方法がわかりません。
以前は、1 つの列 (Chart_ID) を選択してから数値に変換していました。これは、Summarize が文字を出力するためです。 そこから、UniqueVals (Chart_ID のもの) のリストによってソース dt Chart_ID Col を選択することができました。
数値と文字の2つの異なる列でこれを実現するにはどうすればよいですか?
Re: 2 つの列の UniqueVals コンボで選択および除外する方法は?こんにちは、aliegner1 です。
わからないかもしれませんが、重要な p 値を選択し、新しいテーブルをサブセット化してから、Chart_ID と Recipe_ID で要約してみてはいかがでしょうか?
繰り返しますが、私には理解できないかもしれませんが、あなたがしていることはちょっとしたことです」 pハッキング"。少なくとも、p 値に関する ASA ステートメントを読んでから、JMP ヘルプの Statistics Index で False Discovery Rate を調べることをお勧めします。
幸運を!