Skript zum Ausführen einer komplizierten Formel für neue SpaltenDer Versuch herauszufinden, wie eine komplizierte Formel aus der Kurvenanpassung mithilfe der Vorhersageformel geschrieben werden kann. Es ist einfach, wenn alle Daten zusammengefasst sind und es nur eine Formel gibt. Wenn ich die Daten jedoch in kleinere Gruppen aufteile, bleibt mir die Skripterstellung hängen. Ich kann es interaktiv machen, aber ich habe viele verschiedene Datentabellen, so dass das manuelle Eingehen sehr mühsam wird. (Danke im Voraus)
Ich habe JMP-Beispieldaten Big Class als Beispiel verwendet
dt = Current Data Table(); //Big Class active
biv = Bivariate(
Y( :height ),
X( :weight ),
by( :sex, :age ),
Fit Special( xTran( "Log" ), {Line Color( {212, 73, 88} )}, save predicteds )
);
biv << (curve[1] << save predicteds);
Column( N Cols( dt ) ) << set name( "Predicted Values" );
dt << NewColumn("Weight_150", set each value(150));
dt << NewColumn("Weight_180", set each value(180));
// Stuck here want to use the "Predicted Values" formula on the new weights columns added
// basically need a script to copy over formula from "Predicted Values" which is now very complicated
// and replace "weight" with "weight_150" and "weight_180" in the formula, creating two new columns <BR />// extrapolated values at 150 and 180Betreff: Skript zum Ausführen einer komplizierten Formel für neue SpaltenWenn ich richtig verstehe, ist hier ein Weg. Diesem Ansatz ist es egal, wie kompliziert die Formel ist.
NamesDefaultToHere(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp"); //Big Class active
biv = dt << Bivariate(
Y( :height ),
X( :weight ),
by( :sex, :age ),
Fit Special( xTran( "Log" ), {Line Color( {212, 73, 88} )}, save predicteds )
);
biv << (curve[1] << save predicteds);
Column(dt, N Cols( dt ) ) << set name( "Predicted Values" );
dt << NewColumn("Weight_150", set each value(150));
dt << NewColumn("Weight_180", set each value(180));
myFormula = Column(dt, "Predicted Values") << getFormula;
// Stuck here want to use the "Predicted Values" formula on the new weights columns added
// basically need a script to copy over formula from "Predicted Values" which is now very complicated
// and replace "weight" with "weight_150" and "weight_180" in the formula, creating two new columns
// extrapolated values at 150 and 180
myFormula150 = Substitute(NameExpr(myFormula), Expr(:weight), Expr(:weight_150));
dt << NewColumn( "Predicted Values 150" );
addFormula = Expr(Column(dt, "Predicted Values 150") << setFormula(formulaTBD));
SubstituteInto(addFormula, Expr(formulaTBD), NameExpr(myFormula150));
addFormula;
myFormula180 = Substitute(NameExpr(myFormula), Expr(:weight), Expr(:weight_180));
dt << NewColumn( "Predicted Values 180" );
addFormula = Expr(Column(dt, "Predicted Values 180") << setFormula(formulaTBD));
SubstituteInto(addFormula, Expr(formulaTBD), NameExpr(myFormula180));
addFormula;
dt << runFormulas;