如何透過X將變數傳遞給Fit Life中的X參數?大家好,
I need to dynamically pass variables to the X parameter in the fit life by x function. The first part of my code generates the analysis report as expected, but the second part only brings up the startup window without a report.
我的程式碼如下所示:
Names Default To Here(1);
dt = Open( "$sample_data/big class.jmp" );
x_var = "sex";
y_var = "weight";
obj1 = dt << Fit Life by X(
Distribution( Weibull ),
Nested Model Tests( Location and Scale ),
Y( Eval(y_var) ),
X( :sex ),
);
wait(2);
obj2 = dt << Fit Life by X(
Distribution( Weibull ),
Nested Model Tests( Location and Scale ),
Y( :weight ),
X( Eval(x_var) ),
);
有沒有人遇到過這個問題或知道如何正確地將變數傳遞給 X 參數?
謝謝!
自動化和腳本編寫可靠度分析回覆:如何透過 X 將變數傳遞給 Fit Life 中的 X 參數?請看以下內容。
由於缺少“Relationship”,程式碼會嘗試根據 X 進行最佳猜測。因此,提供完整的訊息,程式碼不需要陷入陷阱。
Names Default To Here(1);
dt = Open( "$sample_data/big class.jmp" );
x_var = "sex";
y_var = "weight";
obj1 = dt << Fit Life by X(
Distribution( Weibull ),
Relationship( Location and Scale ),
Nested Model Tests( Location and Scale ),
Y( Eval(y_var) ),
X( :sex ),
);
wait(2);
obj2 = dt << Fit Life by X(
Distribution( Weibull ),
Relationship( Location and Scale ),
Nested Model Tests( Location and Scale ),
Y( :weight ),
X( Eval(x_var) ),
);
回覆:如何透過 X 將變數傳遞給 Fit Life 中的 X 參數?這似乎需要更多的工作來解決,因為「正常」強制不起作用
Names Default To Here(1);
dt = Open("$sample_data/big class.jmp");
x_var = "sex";
y_var = "weight";
myexpr = EvalExpr(dt << Fit Life by X(
Distribution( Weibull ),
Nested Model Tests( Location and Scale ),
Y( :weight ),
X(Expr(NameExpr(AsColumn(dt, x_var)))),
));
show(myexpr);
obj = Eval(myexpr);
我會說使用 Eval(Parse()) (邪惡解析)的極其罕見的情況之一,但這似乎有效
Names Default To Here(1);
dt = Open("$sample_data/big class.jmp");
x_var = "sex";
y_var = "weight";
obj2 = Eval(Parse(Eval Insert("\[dt << Fit Life by X(
Distribution(Weibull),
Nested Model Tests(Location and Scale),
Y(:weight),
X(:^x_var^)
)]\")));回覆:如何透過 X 將變數傳遞給 Fit Life 中的 X 參數?此異常似乎是一個錯誤。在第二種情況下,嵌套模型測試參數不被辨識。請將其報告給 JMP 技術支援 ( support@jmp.com ),以便將其輸入作為缺陷並進行追蹤。
回覆:如何透過 X 將變數傳遞給 Fit Life 中的 X 參數?哦,這正是正確的答案。非常感謝!
回覆:如何透過 X 將變數傳遞給 Fit Life 中的 X 參數?這也是另一種解決方法。謝謝你!