선형 최소 제곱 모델 적합에서 매개변수 추정 표에서 기울기와 절편을 추출하여 파일에 저장해야 합니다.제 코드가 작동하지 않고 그 이유를 파악하는 데 어려움이 있습니다. 도움을 주시면 감사하겠습니다. 감사합니다!
dt = Open("C:\Users\trcampbell\Desktop\MASTER ECOLI\2025\2024.xlsx");
obj = Fit model(
Y( :LOGECOLI ),
Effects( :LOGTURB),
Personality( "Standard Least Squares" ),
Emphasis( "Effect Leverage" ),
Run(:LOGECOLI )) ;
// Extract slope and intercept
reportObj = obj << Report;
paramTable = reportObj( "Parameter Estimates" );
// Extract values from Parameter Estimates table
intercept = paramTable[estimate(1)]; //1st column
slope = paramTable[estimate(2)]; //2nd column
// Create a new data table to store the results
results = New Table( "Fit Results",
Add Column( "Parameter", Character, Set Values( {"Slope", "Intercept"} ) ),
Add Column( "Value", Numeric, Set Values( {slope, intercept} ) )
);
// Save the results to an Excel spreadsheet
results << Export( "C:\\Users\\trcampbell\\Desktop\\MASTER ECOLI\\2025\\validation results\\test xxx.xlsx");
자동화 및 스크립팅Re: 선형 최소 제곱 모델 적합에서 매개변수 추정 표에서 기울기와 절편을 추출하여 파일에 저장해야 함안녕하세요 @러닝_JSL ,
'데이터 테이블로 만들기' 기능을 활용해 세부 정보를 가져오도록 스크립트를 변경했지만, 스크립트에서 발생한 문제점을 해결하기 위해 매개변수를 변경하여 테이블의 특정 추정 섹션을 타겟으로 추가했습니다. 이를 수행하는 방법을 알고 싶다면 마우스 오른쪽 버튼을 클릭하고 속성을 선택한 다음 추정 섹션을 강조 표시하여 개체의 경로를 찾는 것이 가장 좋습니다.
여기 샘플 데이터 폴더를 사용해 이것이 제대로 작동하는지 테스트해 보았습니다.
dt=Open("$SAMPLE_DATA/Tablet Production.jmp");
obj = Fit model(
Y( :Dissolution ),
Effects( :Mill Time),
Personality( "Standard Least Squares" ),
Emphasis( "Effect Leverage" ),
Run(:Dissolution )) ;
// Extract slope and intercept
reportObj = obj << Report;
paramTable = ReportObj["Response Dissolution","Whole Model","Parameter Estimates",TableBox(1)]; //Change the report to target the table that needs saving
/*In the old method you had, you could instead make param table this to target the specific estimate column, just change the Y name:
paramTable = reportObj["Response Dissolution","Whole Model","Parameter Estimates",NumberColBox("Estimate")];*/
// Extract values from Parameter Estimates table
/*intercept = paramTable[1]; //1st column - grab the first item [corrected from what you had]
slope = paramTable[2]; //2nd column - grab the second item*/
dtnew=paramTable<<MAKE into="" data="https://community.jmp.com/" table=""></MAKE>Re: 선형 최소 제곱 모델 적합에서 매개변수 추정 표에서 기울기와 절편을 추출하여 파일에 저장해야 함고맙네요, 벤.
다음과 같은 오류가 발생합니다.

Re: 선형 최소 제곱 모델 적합에서 매개변수 추정 표에서 기울기와 절편을 추출하여 파일에 저장해야 함
나에게도 같은 코드가 작동합니다
dt=Open("$SAMPLE_DATA/Tablet Production.jmp");
obj = Fit model(Y( :Dissolution ),Effects( :Mill Time),Personality( "Standard Least Squares" ),Emphasis( "Effect Leverage" ),Run(:Dissolution )) ;
rpt=obj<<REPORT></REPORT>
<P>이전 버전의 JMP를 사용하고 있는 것일 수 있나요?<BR /> 다른 플랫폼을 사용해 보는 게 어떨까</P>
<BR />
<P>X로 y를 맞추다</P>
<CODE class=" language-jsl">Names Default To Here( 1 );
rpt = New Window( "Tablet Production - Fit Y by X of Dissolution by Mill Time",
Data Table( "Tablet Production.jmp" ) <<
Bivariate(Y( :Dissolution ),X( :Mill Time ),
Fit Line( {Line Color( {230, 159, 0} )} )
)
);
rpt["Bivariate Fit of Dissolution By Mill Time", "Linear Fit", "Parameter Estimates",
Table Box( 1 )] << Make Into Data Table;
아니면 이거
곡선 맞춤
Names Default To Here( 1 );
rpt = New Window( "Tablet Production - Fit Curve of Dissolution by Mill Time",
Data Table( "Tablet Production.jmp" ) <<
Fit Curve( Y( :Dissolution ), X( :Mill Time ), Fit Linear ));
rpt["Fit Curve", "Linear", "Parameter Estimates", Table Box( 1 )] <<
Make Into Data Table;
Re: 선형 최소 제곱 모델 적합에서 매개변수 추정 표에서 기울기와 절편을 추출하여 파일에 저장해야 함참조를 찾을 때 고려할 작은 변경 사항 하나는 첫 번째 개요 상자 참조(이 경우 "Dissolution")에서 열 이름을 삭제하는 것입니다. 이렇게 하면 더 견고해집니다. 해당 개요 상자를 무시하거나 열 대신 와일드카드 "?"를 사용할 수 있습니다.
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Drug.jmp");
fm = dt << Fit Model(
Y(:y),
Effects(:Drug, :x),
Personality(Standard Least Squares),
Run Model()
);
rep = Report(fm);
// tb_param_estimates1 = rep["Whole Model", "Parameter Estimates", TableBox(1)];
tb_param_estimates2 = rep["Response ?", "Whole Model", "Parameter Estimates", TableBox(1)];
보통 저는 거기에 그 개요 상자도 추가하지만 그것은 선호사항입니다.
rep[OutlineBox("Response ?"), OutlineBox("Whole Model"), OutlineBox("Parameter Estimates"), TableBox(1)];Re: 선형 최소 제곱 모델 적합에서 매개변수 추정 표에서 기울기와 절편을 추출하여 파일에 저장해야 함정말 고맙습니다!
Re: 선형 최소 제곱 모델 적합에서 매개변수 추정 표에서 기울기와 절편을 추출하여 파일에 저장해야 함고맙습니다, Jarmo!! 정말 고맙습니다!