「除外された」行を無視するこんにちは、
私はまだJSLの「こぶ」を乗り越えようとしているので、根本的な質問は許してください。
問題:
-サンプルサフィックスa1、a2、およびa3を持つ3つのレプリケートのデータセットを含むサンプルテーブルがあります。
-場合によっては、レプリケートの1つを「除外」状態に設定する必要があります(以下の例はa2です)。
-テーブルを開き、除外されなかったセットのみを計算に適用するバッチスクリプトを作成しています。
-しかし、3つすべてのデータがまだ検討されているため、(以下に示す)私の試みにはまだ参加していません。
-除外されていない行を識別し、サフィックスの検索を適用するには、「and」ステートメントが必要になる場合があるように感じます。
どんな入力でも、最も感謝するでしょう。
ありがとうニール
states = Current Data Table() << Get Row States();
For( i = 1, i <= N Rows( states ), i++,
rs = As Row State( states[i] );
if (Excluded(rs)==0,
a1 = dt << Get Rows Where(Contains(:Sample,"a1"));
a2 = dt << Get Rows Where(Contains(:Sample,"a2"));
a3 = dt << Get Rows Where(Contains(:Sample,"a3"));
);
)
データ表Re:「除外された」行を無視する除外された行のリストを繰り返し処理しているように見えますが、毎回同じ分析を行っています。実際には、除外された行のリストはどこにも参照されていません。これが問題を解決する可能性のある1つの方法です。一致する行と除外された行を取得し、リストから除外された行を削除するだけです。
Names default to here(1);
//Make a sample dataset with some excluded rows
dt = Open("$Sample_data/iris.jmp");
excluded rows to set = [ 4, 9, 52 ];
dt << Select Rows( excluded rows to set );
dt << Exclude(1);
//Find all matching rows and load in associative array, useful for Remove From function later
species matches = associative array(dt << Get Rows Where(:Species == "setosa"));
//get excluded rows
excluded rows = dt << get excluded rows();
//remove excluded rows from the list of rows matching the species
Remove From (species matches, excluded rows);
//get the matching rows as a list
speciesmatches << get keys;Re:「除外された」行を無視するつまり、
入力に感謝します。 私はまだ少し初心者ですが、連想配列の概念を突き刺しました。 コードが表示され、「キーの取得」まで機能します。 ただし、必要な計算を行うために「speciesmatches」から必要な情報を取得する方法がまだわかりません(最後の6行がリストされています)。 除外されたセットを含む典型的なテーブルの画像を撮りました。
ニール
dt = Open( path );
// Find row that were excluded and load into list
Exc_row = dt << Get Excluded Rows;
dt << Select Rows( Exc_row );
dt << Exclude(1);
//Find all matching rows and load in associative array, useful for Remove From function later
species matches = associative array(dt << Get Rows Where(Contains(:Sample,"a1") |Contains(:Sample,"a2") |Contains(:Sample,"a3")));
//get excluded rows
Exc_row = dt << get excluded rows();
//remove excluded rows from the list of rows matching the species
Remove From (species matches, Exc_row);
//get the matching rows as a list
speciesmatches << get keys;
// What needs to be done to get mean of three (or 2 sets in the case of exclusion see table image)
a1 = dt << Get Rows Where(Contains(:Sample,"a1"));
a2 = dt << Get Rows Where(Contains(:Sample,"a2"));
a3 = dt << Get Rows Where(Contains(:Sample,"a3"));<BR />
c1 = Column("Image A pore area (%)");
mean1 = Mean(c1[a1[1]], c1[a2[1]], c1[a3[1]]);
Re:「除外された」行を無視するこれは、虹彩データテーブルの各種を調べ、その基準に一致する行の平均を計算する更新されたスクリプトです。そうは言っても、あなたが何をしているのかがよくわかったので、これを別の方法で行い、代わりに表を使用してそれらの値を見つけるでしょう。
Names default to here(1);
//Make a sample dataset with some excluded rows
dt = Open("$Sample_data/iris.jmp");
excluded rows to set = [ 4, 9, 52 ];
dt << Select Rows( excluded rows to set );
dt << Exclude(1);
species list = {"setosa", "versicolor", "virginica"};
//For each species
for(s=1, s<= n items (species list), s++,
//Find all matching rows and load in associative array, useful for Remove From function later
species matches = associative array(dt << Get Rows Where(:Species == species list[s]));
//get excluded rows
excluded rows = dt << get excluded rows();
//remove excluded rows from the list of rows matching the species
Remove From (species matches, excluded rows);
//get the matching rows as a list, use that to find which rows to average
mn = mean( :Sepal length[speciesmatches << get keys] );
//output averages to the log
write(species list[s] || " mean = " || char(mn) || "\!n")
);
表を使用するオプション:
Names default to here(1);
//Make a sample dataset with some excluded rows
dt = Open("$Sample_data/iris.jmp");
excluded rows to set = [ 4, 9, 52 ];
dt << Select Rows( excluded rows to set );
dt << Exclude(1);
//New column with the check for each value
New Column("Species_", Character, "Nominal", Formula(If(Contains(:Species, "se"), "se", Contains(:Species, "ve"), "ve", Contains(:Species, "vi"), "vi")));
//tabulate to find averages - script copied from 'source' of data table after selecting
//'make into data table' from tabulate platform, then inserted dt reference
dtTab = (dt << Tabulate(
Set Format( Mean( :Sepal length( 10, 4 ) ) ),
Add Table(
Column Table( Analysis Columns( :Sepal length ), Statistics( Mean ) ),
Row Table( Grouping Columns( :Species_ ) )
)
)) << Make Into Data Table;
//Now get values from the table
dtTab:"Mean(Sepal length)"n[dtTab << Get Rows Where(:Species_ == "se")];Re:「除外された」行を無視するどうもありがとう!
これを試してみて、どうなるか見てみましょう。
元々の目的は、各セット(a1、a2、およびa3)の1つの行から気孔率を取得し、平均を取得することでした。 気孔率は各複製で同じですが、3つの異なるポイントと平均を抽出する簡単な方法を見つけることができませんでした。
もう一度入力していただきありがとうございます。
ニール
Re:「除外された」行を無視する間違いなく、表形式のプラットフォームと要約JSL関数の両方を見てください。どちらも、かなり迅速に答えを得ることができると思います。