JMP-Skript zum Generieren eines kumulativen Werts nach der ModellierungHallo zusammen
Ich bin neu bei JMP und habe versucht, ein Skript zu schreiben
Ich verwende JMP 18 Standard und führe eine Rekurrenzanalyse durch. Das von mir verwendete Modell ist loglineares NHPP. Ich möchte spezifische kumulative Werte für 100.000, 200.000, 300.000, 400.000 und 500.000 Transaktionen generieren. Ich sehe, dass es in der Benutzeroberfläche für jede Transaktion eine Klickoption gibt (siehe Anhang). Ich möchte dies jedoch mithilfe von Skripten automatisieren. Folgendes Skript habe ich ausprobiert: Es erzeugt einen Fehler in der Abbildung. Könnten Sie mir mit dem Code helfen?


// 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 );
);
Automatisierung und SkriptingBetreff: JMP-Skript zum Generieren eines kumulativen Werts nach der ModellierungWahrscheinlich möchten Sie Table Box in Ihren Berichtsindex einbinden, anstatt eine Nachricht an ihn zu senden
estimates_table = rec_report["Loglinear NHPP Report", "Estimates", Table Box(1)]
Außerdem denke ich, dass Ihre "Schätzungen" "Parameterschätzungen" sein sollten (oder verwenden Sie das Platzhalterzeichen ?). Hier ist ein Beispiel bis zu diesem Punkt mit den Beispieldaten von 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;
Betreff: JMP-Skript zum Generieren eines kumulativen Werts nach der ModellierungHallo, hier bitte.
Es funktioniert jetzt. Vielen Dank.
Ich sollte nicht versuchen, meine eigene Formel zu erstellen. Nachdem ich das Modell in JMP ausgeführt habe, gibt es unter „Angepasstes Rekurrenzmodell“ die Option „Spezifische Intensität und Kumulativ“. Es kann den kumulativen Wert mit Konfidenzintervall generieren. Ich kann einfach die Formel verwenden, anstatt eine neue zu erstellen. Ich habe versucht, die Formel dazu zu bringen, neue Ergebnisse in einer Tabelle zu generieren. Aber das ist fehlgeschlagen. Können Sie helfen? Der Fehler ist im Bild. Nochmals vielen Dank.

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;
Betreff: JMP-Skript zum Generieren eines kumulativen Werts nach der ModellierungIhr Skript sieht sehr stark aus, als wäre es von KI generiert worden ... Beachten Sie, dass diese nicht im Skriptindex dokumentiert sind (<< Intensitätsformel speichern und << Kumulative Formel speichern), aber Sie können es „herausfinden“, indem Sie herumbasteln
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();
@julianisch
Betreff: JMP-Skript zum Generieren eines kumulativen Werts nach der ModellierungHallo, jthi
Danke, das funktioniert. Mein gesamter Code wird von KI generiert. Ich habe letzte Woche angefangen, in JMP zu skripten. Ich kann kaum eine einzige Zeile Code alleine schreiben. Gibt es eine Möglichkeit, JMP-Skripte zu lernen?
Danke.
Betreff: JMP-Skript zum Generieren eines kumulativen Werts nach der ModellierungNutzen Sie die erweiterte Anmeldung in JMP und lernen Sie die verschiedenen Methoden kennen, mit denen JMP einige Skripte für Sie erstellen kann. Es gibt auch einen Skriptleitfaden , Sie haben über das Hilfemenü von JMP direkten Zugriff auf den Skriptindex und die JMP-Community bietet zahlreiche Inhalte wie die Einführung in die JMP-Skriptsprache , den JMP Scripters Club und das JSL Cookbook .