既存の Excel スプレッドシートに回帰分析の結果を追加するスクリプトを作成しようとしていますこんにちは。回帰分析の結果を既存の Excel ファイルに追加する JSL スクリプトを作成しようとしています。現在のスクリプトは Excel ファイルに書き込みますが、スクリプトを複数回実行して、新しい結果をそれぞれ既存の Excel シートに追加できるようにしたいと考えています。(現在は、新しい結果を手動で追加しています。) 添付のスクリプトを参照してください。
前もって感謝します!
追伸:私はJMP Pro 17を使用しています
自動化とスクリプトRe: 回帰分析の結果を既存の Excel スプレッドシートに追加するスクリプトを作成しようとしています必要なのは、データ テーブルに新しい列を作成した後、データを追加する Excel テーブルを読み取り、「テーブル」=>「連結」を使用して、データを追加するテーブルに新しいテーブルを追加し、新しく連結したものを保存することのようです。
Re: 回帰分析の結果を既存の Excel スプレッドシートに追加するスクリプトを作成しようとしていますありがとう、ジム。分析を実行してテーブルを追加するスクリプトが X という名前のファイルを生成する場合、連結の前にまず X を保存する必要がありますか? そうであれば、連結関数内のテーブル名は、すべての実行の結果を受け取るファイル (つまり、連結 (マスターファイル)) ですか?
したがって、上記が正しければ、私は次のように言います。
Xを保存
連結(マスターファイル)
マスターファイルを保存する
スクリプトを再実行
これを正しく読んでいますか?
Re: 回帰分析の結果を既存の Excel スプレッドシートに追加するスクリプトを作成しようとしていますはい
Re: 回帰分析の結果を既存の Excel スプレッドシートに追加するスクリプトを作成しようとしています実行後に開くのがこれです。(不思議なことに、これは私の jsl コードが使用していない残存ファイル名 (v2n=25....) を示しています。何度も確認しました)。いずれにしても、以下に示すコードは連結された行を生成しません。

dt << save("C:\Users\trcampbell\Desktop\MASTER ECOLI\2024\regression analysis\validation runs\testtest2 n=258.xls");
/// 追加スクリプトを追加
Concatenate("C:\Users\trcampbell\Desktop\MASTER ECOLI\2024\regression analysis\validation runs\masterfile n=258.xls") ;
//すべての実行の行(追加)を含むマスターファイルを保存します
dt<< save("C:\Users\trcampbell\Desktop\MASTER ECOLI\2024\regression analysis\validation runs\masterfile n=258.xls");
ご提案があれば、ぜひお聞かせください。
Re: 回帰分析の結果を既存の Excel スプレッドシートに追加するスクリプトを作成しようとしています「最初のテーブルに追加」というチェックボックスをオンにしてみてください。
Re: 回帰分析の結果を既存の Excel スプレッドシートに追加するスクリプトを作成しようとしています残念ながら、それは役に立ちませんでした。連結スクリプトはまだ機能していません。(興味深いことに、スクリプトがプロセスを自動化する場合、スクリプトを実行するたびにポップアップ ウィンドウのチェック ボックスをクリックする必要がある理由がわかりません。)
また (おそらく連結スクリプトが機能していないこととは関係ありませんが)、何らかの理由で、スクリプトが実行するように指示したファイルではなく、残存ファイル (現在は削除されたファイル) が実行の開始時に開かれます。なぜこのようなことが起こるのかはわかりません。

次に回帰を実行し、実行結果に基づいていくつかの列を追加して、次に...

Re: 回帰分析の結果を既存の Excel スプレッドシートに追加するスクリプトを作成しようとしていますここに、新しいデータをマスターファイルに連結するために必要なことを明確にするサンプルスクリプトがあります。
names default to here(1);
// Create 2 data tables and save them as excel files
// one will be the master and one will play the role of the new data
dtExample = open("$SAMPLE_DATA/big class.jmp");
theTables =dtExample << Subset(
By( :sex ),
All rows,
Selected columns only( 0 ),
columns( :name, :age, :height, :weight )
);
close( dtExample, nosave );
// Change the names of the first table to Master
theTables[1] << set name("Master");
data table("Master") << bring window to front;
// Add the new columns to the master, like your master file already
// has all of the columns. In this example, I will only add 1 column
data table("Master")<< new column("Ratio", set each value(:height/:weight));
// Wait 5 seconds so you can observe the master table
wait(5);
// save and close the Master table as an excel table
close( data table("Master"), save("$TEMP/master.xlsx"));
// Change the name of the second table to New Data
theTables[2] << set name("New Data");
data table("New Data") << bring to front;
// wait 5 seconds here too, so you can observe the New Data table
wait(5);
// now save and close the New Data table as an excel table
close( data table("New Data"), save("$TEMP/New Data.xlsx"));
// Now that there are a Master and a New Data table that have been
// created we can now illustrate how to read in some new data,
// add the required new columns, save it, then open the master file,
// and concatenate the new data to the master and then save the updated
// master file
// open the new data table. I am using the variable dt as the pointer
// to the file, since that is what you are doing in your script
dt = open("$TEMP/New Data.xlsx");
// Add the new columns (in this example, only 1 column) to the data table
// your syntax is
// new column("ratio", formula(:height/:weight);
// I suggest that you become more precise and point to the specific data table
// by using either
// dt << New Column(......);
// or
// data table("New Data") << New Column( ...... );
data table("New Data") << New Column( "Ratio", formula(:height/:weight));
// Now the data can be saved
// use either
// dt<< save(...........);
// or
// data table("New Data")<< save(................);
dt << save("$TEMP\test1 n=22.xlsx");
// now open the master table
dtMaster = open("$TEMP\master.xlsx");
// concatenate the new data table to the master
dtMaster << concatenate( dt, append to first table(1));
// now save the master
dtMaster << save("$TEMP\master.xlsx");
// uncomment the below code if you want to close the new data and the master tables
// close( dt, nosave );
// close( dtMaster, nosave );
Re: 回帰分析の結果を既存の Excel スプレッドシートに追加するスクリプトを作成しようとしています素晴らしいです。ありがとう、ジム!