기존 Excel 스프레드시트에 회귀 분석 결과를 추가하는 스크립트를 작성하려고 합니다.안녕하세요 - 기존 Excel 파일에 회귀 분석 결과를 추가하는 jsl 스크립트를 작성하려고 합니다. 현재 스크립트는 Excel 파일에 쓰지만 스크립트를 여러 번 실행하고 각각의 새 결과를 기존 Excel 시트에 추가할 수 있기를 원합니다. (현재는 새 결과를 수동으로 추가하고 있습니다.) 첨부된 스크립트를 참조하세요.
미리 감사드립니다!
ps. 저는 JMP Pro 17을 사용하고 있습니다.
자동화 및 스크립팅Re: 기존 Excel 스프레드시트에 회귀 분석 결과를 추가하는 스크립트를 작성하려고 합니다.당신이 해야 할 일은 데이터 테이블에 새 열을 만든 후 데이터를 추가할 Excel 테이블을 읽고 Tables=>Concatenate를 사용하여 새 테이블을 추가해야 한다는 것입니다. 데이터를 추가하려는 테이블을 선택한 다음 새로 연결된 데이터를 저장합니다.
Re: 기존 Excel 스프레드시트에 회귀 분석 결과를 추가하는 스크립트를 작성하려고 합니다.고마워요 짐. 분석을 실행하고 테이블을 추가하는 스크립트가 X라는 파일을 생성하는 경우 연결하기 전에 먼저 X를 저장해야 합니까? 그렇다면 내 Concatenate 함수 내의 테이블 이름은 모든 실행의 결과를 수신하는 파일입니까(예: Concatenate(masterfile)?
따라서 위의 내용이 맞다면 다음과 같이 말할 수 있습니다.
저장 X
연결(마스터파일)
마스터파일 저장
스크립트 다시 실행
내가 이것을 올바르게 읽고 있습니까?
Re: 기존 Excel 스프레드시트에 회귀 분석 결과를 추가하는 스크립트를 작성하려고 합니다.예
Re: 기존 Excel 스프레드시트에 회귀 분석 결과를 추가하는 스크립트를 작성하려고 합니다.실행 후 열리는 내용입니다. (흥미롭게도 내 jsl 코드에서 사용하지 않는 유물 파일 이름(v2n=25....)이 표시됩니다. 확인하고 다시 확인했습니다.) 어떤 경우에도 아래에 표시된 다음 코드는 연결된 행을 생성하지 않습니다.

dt << save("C:\Users\trcampbell\Desktop\MASTER ECOLI\2024\회귀 분석\검증 실행\testtest2 n=258.xls");
///추가 스크립트 추가
Concatenate("C:\Users\trcampbell\Desktop\MASTER ECOLI\2024\regression analyze\validation running\masterfile n=258.xls") ;
//모든 실행의 행(추가)을 포함하는 마스터파일 저장
dt<< save("C:\Users\trcampbell\Desktop\MASTER ECOLI\2024\회귀 분석\검증 실행\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 스프레드시트에 회귀 분석 결과를 추가하는 스크립트를 작성하려고 합니다.훌륭해요 - 고마워요, 짐!