모델링 후 누적 값을 생성하는 JMP 스크립트안녕하세요 여러분
저는 JMP를 처음 사용하며 스크립트를 작성하려고 했습니다.
JMP 18 표준을 사용하여 재귀 분석을 수행합니다. 제가 사용하는 모델은 로그선형 NHPP입니다. 10만, 20만, 30만, 40만, 50만 건의 거래 건수에 대한 특정 누적 값을 생성하고 싶습니다. UI에 각 거래 건에 대한 클릭 옵션이 있는 것을 확인했습니다(첨부 파일 참조). 하지만 스크립트를 사용하여 이 작업을 자동화하고 싶습니다. 제가 시도한 스크립트는 다음과 같습니다. 그림에서 오류가 발생합니다. 코드 작성을 도와주실 수 있나요?


// Run the analysis and capture the report
rec_report = Recurrence Analysis(
Y( :Accumulated Transactions ),
Label( :BOT ID ),
Cost( :SAP Purchase Price ),
Grouping( :Bot Series ),
Event Plot( 0 ),
MCF Confid Limits( 1 ),
Fit Model(
Scale Effects( :Bot Series ),
Shape Effects( :Bot Series ),
Run Model,
Model Type( "Loglinear Nonhomogeneous Poisson Process" )
)
);
// --- Extract Estimates ---
// Get the "Estimates" table directly from the report and convert it to a scriptable object
estimates_table = rec_report["Loglinear NHPP Report", "Estimates"] << Table Box;
// Get the 'Estimate' column values as a list.
// The order is consistently Lambda, then Beta.
estimates_list = estimates_table << Get Values( "Estimate" );
// Assign the parameter estimates from the list
lambda_hat = estimates_list[1]; // Lambda (λ) is the first estimate
beta_hat = estimates_list[2]; // Beta (β) is the second estimate
// Define the transactions for which to calculate values
transactions = {100000, 200000, 300000, 400000, 500000};
// Calculate and display intensity and cumulative values
For( i = 1, i <= N Items( transactions ), i++,
transaction_time = transactions[i];
// Cumulative Mean Function C(t) = λ * t^β
cumulative = lambda_hat * (transaction_time ^ beta_hat);
// Instantaneous Intensity λ(t) = λ * β * t^(β-1)
intensity = lambda_hat * beta_hat * (transaction_time ^ (beta_hat - 1));
// Print the results to the log
Show( transaction_time, cumulative, intensity );
);
자동화 및 스크립팅Re: 모델링 후 누적 값을 생성하는 JMP 스크립트메시지를 보내는 대신 보고서 구독자 내에 테이블 상자를 포함시키고 싶을 가능성이 큽니다.
estimates_table = rec_report["Loglinear NHPP Report", "Estimates", Table Box(1)]
또한 "추정치"는 "매개변수 추정치"(또는 ? 와일드카드 사용)로 해야 한다고 생각합니다. JMP 샘플 데이터를 사용한 예시는 다음과 같습니다.
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Reliability/Bladder Cancer.jmp");
ra = dt << Recurrence Analysis(
Y(:Age),
Label(:Patient Number),
Cost(:Cost),
Grouping(:Treatment Group),
Event Plot(1),
Fit Model(
Scale Effects(:Intensity),
Shape Effects(:Intensity),
Run Model,
Model Type("Power Nonhomogeneous Poisson Process")
)
);
tb = Report(ra)[OutlineBox("Fitted Recurrence Model"), OutlineBox("Parameter Estimates"), TableBox(1)];
estimates = tb[NumberColBox("Estimate")] << get;
Re: 모델링 후 누적 값을 생성하는 JMP 스크립트안녕하세요. 여기 있습니다.
이제 작동합니다. 정말 감사합니다.
제가 직접 공식을 만들려고 하면 안 됩니다. JMP에서 모델을 실행하면 '적합된 재발 모델' 아래에 '특정 강도 및 누적'이라는 항목이 있습니다. 이 항목을 사용하면 신뢰 구간을 포함한 누적 값을 생성할 수 있습니다. 새 공식을 만드는 대신 이 공식을 사용하면 됩니다. 공식을 사용하여 표에 새 결과를 생성하려고 했지만 실패했습니다. 도와주시겠어요? 이미지에 오류가 있습니다. 다시 한번 감사드립니다.

Names Default To Here( 1 );
// --- Run the analysis ---
rec_report = Recurrence Analysis(
Y( :Accumulated Transactions ),
Label( :BOT ID ),
Cost( :SAP Purchase Price ),
Grouping( :Bot Series ),
Event Plot( 0 ),
MCF Confid Limits( 1 ),
Fit Model(
Scale Effects( :Bot Series ),
Shape Effects( :Bot Series ),
Run Model,
Model Type( "Loglinear Nonhomogeneous Poisson Process" )
)
);
// --- Save JMP’s own formulas into the source table ---
rec_report << Save Intensity Formula;
rec_report << Save Cumulative Formula;
// Grab those formulas so we can reuse them in a clean table
dt_src=Current Data Table();
intensity_formula = Column( dt_src, "Intensity" ) << Get Formula;
cumulative_formula = Column( dt_src, "Cumulative" ) << Get Formula;
// --- Define the transaction times you care about ---
transactions = {100000, 200000, 300000, 400000, 500000};
// --- Build a results table with JMP-calculated fitted values ---
dt_sic = New Table( "Specific Intensity and Cumulative",
New Column( "Accumulated Transactions", Numeric, "Continuous", Values( transactions ) ),
New Column( "Intensity", Numeric, Formula( intensity_formula ) ),
New Column( "Cumulative", Numeric, Formula( cumulative_formula ) )
);
// Evaluate formulas and show the table
dt_sic << Recalculate;
dt_sic << Bring Window To Front;
Re: 모델링 후 누적 값을 생성하는 JMP 스크립트귀하의 스크립트는 AI가 생성한 것과 매우 유사합니다. 이러한 내용은 스크립팅 인덱스(<< 강도 공식 저장 및 << 누적 공식 저장)에 문서화되어 있지 않지만, 이를 조정하여 "알아낼" 수 있습니다.
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Reliability/Bladder Cancer.jmp");
ra = dt << Recurrence Analysis(
Y(:Age),
Label(:Patient Number),
Cost(:Cost),
Grouping(:Treatment Group),
Event Plot(1),
Fit Model(
Scale Effects(:Age),
Run Model,
Model Type("Proportional Intensity Poisson Process")
)
);
fit = Report(ra)[OutlineBox("Fitted Recurrence Model")] << Get Scriptable Object;
intensity_col = fit << Save Intensity Formula;
cumul_col = fit << Save Cumulative Formula;
i_f = intensity_col << Get Formula;
c_f = cumul_col << Get Formula;
transactions = {1, 2, 3, 4, 5};
dt_s = New Table("Specific Intensity and Cumulative",
New Column("Age", Numeric, "Continuous", Values(transactions))
);
Eval(Eval Expr(
dt_s << New Column("Intensity", Numeric, Continuous, Formula(
Expr(NameExpr(i_f))
));
));
Eval(Eval Expr(
dt_s << New Column("Cumulative", Numeric, Continuous, Formula(
Expr(NameExpr(c_f))
));
));
Write();
@줄리안
Re: 모델링 후 누적 값을 생성하는 JMP 스크립트안녕, jthi
감사합니다. 잘 됩니다. 제 코드는 모두 AI가 생성한 것입니다. 지난주에 JMP로 스크립트를 작성하기 시작했는데, 혼자서는 코드 한 줄도 제대로 작성하지 못합니다. JMP 스크립트를 배울 수 있는 곳이 있을까요?
감사해요.
Re: 모델링 후 누적 값을 생성하는 JMP 스크립트JMP의 향상된 로그인 기능을 활용하고 JMP가 스크립트를 생성하는 다양한 방법을 알아보세요. 스크립팅 가이드 도 있으며, JMP 도움말 메뉴에서 스크립팅 인덱스에 직접 접근할 수 있습니다. JMP 커뮤니티에는 JMP 스크립팅 언어 소개 , JMP 스크립터 클럽 , JSL 쿡북 등 다양한 콘텐츠가 있습니다.