回复:腳本中的列切換器功能僅報告第一個變量我不確定問題是什麼。 我的例子似乎工作正常(或者我可能遺漏了什麼)
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Job Satisfaction.jmp");
obj = dt << Fit Model(
Y(:Satisfaction_Avg),
Effects(
:Support_L, :Goal_L, :Work_L, :Interact_L, :Person_C,
:Interact_L * :Person_C
),
Personality( "Proportional Hazard" ),
Emphasis("Effect Leverage"),
Run(
:Satisfaction_Avg << {Summary of Fit(1), Analysis of Variance(1),
Parameter Estimates(1), Scaled Estimates(0), Plot Actual by Predicted(1),
Plot Regression(0), Plot Residual by Predicted(1),
Plot Studentized Residuals(0), Plot Effect Leverage(1),
Plot Residual by Normal Quantiles(0), Box Cox Y Transformation(0)}
)
);
col_switcher = obj << Column Switcher(
:Person_C,
{:Person_C, :Intra_C, :Inter_C, General_S}
);


回复:腳本中的列切換器功能僅報告第一個變量附錄:我希望 Column Switcher 函數會為每個變量生成新的 Effect Summary 表。該腳本適用於第一個變量,然後您可以手動滾動列切換器以查看其他變量。我不想手動滾動列表。這可能嗎?
回复:腳本中的列切換器功能僅報告第一個變量謝謝 jthi 的快速回复。我將你的腳本合併到我的腳本中並遇到了同樣的問題。輸出表僅包含 Two_Deoxyuridine 的結果,但不包含開關列表中的其他變量。我確實運行了您的腳本並且它按預期工作。
我對這個腳本哪裡出了問題有什麼想法嗎?
安娜貝爾
obj = dt << Fit Model(
Y( :dthtt ),
Effects(
:race1c, :PC1, :PC2, :PC3, :age2c, :gender1, :bmi2c.x, :chol2.x, :curalc2.x, :pkyrs2c.x, :dbp2c.x,
:sbp2c.x, :creatin1.x, :glucos2c.x, :APOE_INT, :Two_Deoxyuridine_INT,
:APOE_INT * :Two_Deoxyuridine_INT
),
Personality( "Proportional Hazard" ),
Emphasis( "Effect Leverage" ),
Censor( :dth ),
Censor Code( "0" ),
Run(
:dthtt << {Summary of Fit( 1 ), Analysis of Variance( 1 ), Parameter Estimates( 1 ),
Scaled Estimates( 0 ), Plot Actual by Predicted( 1 ), Plot Regression( 0 ),
Plot Residual by Predicted( 1 ), Plot Studentized Residuals( 0 ), Plot Effect Leverage( 1 ),
Plot Residual by Normal Quantiles( 0 ), Box Cox Y Transformation( 0 )}
)
);
ColumnSwitcherObject = obj << Column Switcher(
:Two_Deoxyuridine_INT,
{:One_5_Anhydroglucitol_INT, :Two_Deoxyuridine_INT,
:Two_Hydroxybutyric acid_INT, :Two_Hydroxyglutaric acid_INT,
:Two_ketoisovaleric acid_INT, :Three_Hydroxybutyric acid_INT, :Five_MTHF_INT, 回复:腳本中的列切換器功能僅報告第一個變量我在進步!我的主要目標是在每次列切換後獲得 Effect Wald Test 數據表。 最終我將連接這些表。下面的代碼自動啟動列切換器(這可以在日誌中看到)並生成 Effect Wald Test 數據表,但僅針對列切換器中的第一個條目。關於切換時如何從每列獲取 Effect Wald Test 數據表的任何想法?
obj = dt << Fit Model(
Y( :dthtt ),
Effects(
:race1c, :PC1, :PC2, :PC3, :age2c, :gender1, :bmi2c.x, :chol2.x, :curalc2.x, :pkyrs2c.x, :dbp2c.x,
:sbp2c.x, :creatin1.x, :glucos2c.x, :APOE_INT, :One_5_Anhydroglucitol_INT,
:APOE_INT * :One_5_Anhydroglucitol_INT
),
Personality( "Proportional Hazard" ),
Censor( :dth ),
Censor Code( "0" ),
Run(
:dthtt << {Summary of Fit( 1 ), Analysis of Variance( 1 ), Parameter Estimates( 1 ),
Scaled Estimates( 0 ), Plot Actual by Predicted( 1 ), Plot Regression( 0 ),
Plot Residual by Predicted( 1 ), Plot Studentized Residuals( 0 ), Plot Effect Leverage( 1 ),
Plot Residual by Normal Quantiles( 0 ), Box Cox Y Transformation( 0 )}
)
);
ColumnSwitcher = obj << Column Switcher(
:One_5_Anhydroglucitol_INT,
{:One_5_Anhydroglucitol_INT, :Two_Deoxyuridine_INT, :Two_Hydroxybutyric acid_INT,
:Two_Hydroxyglutaric acid_INT, :Dummy variable_INT}
);
pre = Function( {currentColumn, nextColumn, switcher},
Print(
"Before switch: " || (currentColumn << get name) || " >> " || (nextColumn << get name) ||
" [Column Switcher] current: " || (columnSwitcher << Get Current)
);
If( nextColumn << get name == "Dummy variable_INT",
0,
1
);
);
post = Function( {previousColumn, currentColumn, switcher},
Print(
"After switch: " || (previousColumn << get name) || " >> " || (currentColumn << get name) ||
" [Column Switcher] current: " || (columnSwitcher << Get Current)
)
);
columnSwitcher << Make Column Switch Handler( pre, post );
ColumnSwitcher << Set Script(
obj = Data Table( "MESA 2018Events_Exam2Main_Proteomics_Metabolomics_MARCH 13 2023" ) <<
Fit Model(
Y( :dthtt ),
Effects(
:race1c, :PC1, :PC2, :PC3, :age2c, :gender1, :bmi2c.x, :chol2.x, :curalc2.x, :pkyrs2c.x, :dbp2c.x,
:sbp2c.x, :creatin1.x, :glucos2c.x, :APOE_INT, :One_5_anhydroglucitol_INT,
:APOE_INT * :One_5_anhydroglucitol_INT
),
Personality( "Proportional Hazard" ),
Censor( :dth ),
Censor Code( "0" ),
Run( Likelihood Ratio Tests( 0 ) ),
Column Switcher(
:One_5_anhydroglucitol_INT,
{:One_5_Anhydroglucitol_INT, :Two_Deoxyuridine_INT, :Two_Hydroxybutyric acid_INT,
:Two_Hydroxyglutaric acid_INT, :Dummy variable_INT}
)
);
Report( obj )["Effect Wald Tests", Table Box( 1 )] << Make Into Data Table;
obj << Close Window;
);
ColumnSwitcher << Run;
Wait( 5/*seconds, while it animates*/ );回复:腳本中的列切換器功能僅報告第一個變量你好
我解決了我的問題並附上了腳本。一個技巧是在主表中放置一個虛擬變量列,並將其放置在列開關的最終變量之後。這允許列開關正常工作。我的下一步是連接所有 Effect Wald Tests 數據表,我認為這應該不難。我希望這個腳本對社區中的其他人有用。
安娜貝爾
回复:腳本中的列切換器功能僅報告第一個變量你好,
我已經為列切換器函數提供了最終腳本,以提供串聯的數據表。我確實從 JMP 支持那裡得到了一些關於如何連接表格的幫助。 希望這對其他人有幫助。
安娜貝爾
腳本中的列切換器函數僅報告第一個變數你好,
以下腳本傳回輸出報告,其中包含用於切換的第一個變數 (Two_deoxyuridine),但不傳回切換清單中的其他變數。我在腳本索引、YouTube 影片、JMP 社群以及閱讀跳到 JMP 中的章節中尋找了解決方案。解決辦法是插入一個For迴圈嗎?我正在使用 JMP17。
感謝任何和所有的幫助,
安娜貝爾
obj = dt << Fit Model(
Y( :dthtt ),
Effects(
:race1c, :age2c, :gender1, :APOE_INT, :Two_Deoxyuridine_INT,
:APOE_INT * :Two_Deoxyuridine_INT
),
Personality( "Proportional Hazard" ),
Censor( :dth ),
Censor Code( "0" ),
Run( Likelihood Ratio Tests( 0 ) )
);
ColumnSwitcherObject = obj << Column Switcher(
:Two_Deoxyuridine_INT,
{:One_5_Anhydroglucitol_INT, :Two_Deoxyuridine_INT, :Two_Hydroxybutyric acid_INT,
:Two_Hydroxyglutaric acid_INT}
);自動化和腳本編寫品質和工藝工程