새 열에서 복잡한 수식을 실행하는 스크립트예측 공식을 사용하여 곡선 맞춤에서 복잡한 공식을 작성하는 방법을 알아 내려고합니다. 모든 데이터가 함께 모여 있고 하나의 수식 만 있으면 곧장 나갈 것입니다. 그러나 데이터를 더 작은 세트로 나누면 스크립팅이 중단됩니다. 대화식으로 할 수는 있지만 많은 다른 데이터 테이블이 있으므로 수동으로 수행하는 것은 매우 지루합니다. (감사합니다)
JMP 예제 데이터 Big Class를 예로 사용했습니다.
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 180다시 : 새로운 열에 복잡한 수식을 실행하는 스크립트올바르게 이해하면 한 가지 방법이 있습니다. 이 방법은 공식이 얼마나 복잡한지는 중요하지 않습니다.
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;