最大化意願函數後提取輸出我正在「按組」資料集上運行回歸模型 (JMP15) - 即從同一資料表生成 100 多個回歸模型。然後我最大化所有這些群體的願望。我想提取 100 多個模型中每個模型的與「最大需求」相對應的變數值(下圖中圈出的值)。關於如何做到這一點有什麼建議嗎(JSL 或使用 GUI 都可以)?

我可以用一種乏味的方式做到這一點(Ctrl-預測刻畫器-> 因子設定-> 記住設定將每種情況的設定儲存為“記住的設定”,然後我可以使用Ctrl-Make 組合資料表提取該設定。
基礎資料分析與建模回覆:最大化意願函數後提取輸出這是一個做你想做的事的例子。該範例建立一個範例表。然後運行擬合模型。您必須最大化意願,然後運行其餘程式碼以獲得新的輸出表

Names Default To Here( 1 );
dt =
// Open Data Table: Tiretread.jmp
// → Data Table( "Tiretread" )
Open( "$SAMPLE_DATA/Tiretread.jmp" );
dtSub = dt << subset( selected columns( 0 ), selected rows( 0 ), output table( "Subset" ) );
For Each Row(
:Abrasion = :Abrasion + :Abrasion*random normal(0,1);
:MODULUS = :MODULUS + :MODULUS*random normal(0,1);
:ELONG = :ELONG + :ELONG * random normal(0,1);
:HARDNESS = :HARDNESS + :HARDNESS* random normal(0,1);
);
dt << Concatenate(
dtSub,
Output Table( "Concat of Tiretread, Subset" ),
Append to first table,
Create source column
);
Close( dtSub, nosave );
// Run the Model
fm = Fit Model(
Y( :ABRASION, :MODULUS, :ELONG, :HARDNESS ),
By( :Source Table ),
Effects( :SILICA, :SILANE, :SULFUR ),
Personality( "Standard Least Squares" ),
Emphasis( "Effect Leverage" ),
Run(
:ABRASION << {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 )},
:MODULUS << {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 )},
:ELONG << {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 )},
:HARDNESS << {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 )},
Profiler(
1,
Confidence Intervals( 1 ),
Desirability Functions( 1 )
)
)
);
// Stop the JSL
stop();
// Set the Maximize Desirability and the run the code below
// Create an output table
dtMax = New Table( "Desirability",
New Column( "By Group", character ),
New Column( "Silica" ),
New Column( "Silane" ),
New Column( "Sulfer" )
);
// Populate the table getting the Desirability values from the chart
// In this example, the 2 by groups are actually just a replicate of the same
// data, so the output values will be the same.
For Each( {profile}, fm,
dtMax << add rows( 1 );
:By Group[N Rows( dtMax )] = Report( profile )[Outline Box( 1 )] << get title;
:Silica[N Rows( dtMax )] = Report( profile )["Prediction Profiler"][Number Edit Box( 1 )]
<< get;
:Silane[N Rows( dtMax )] = Report( profile )["Prediction Profiler"][Number Edit Box( 2 )]
<< get;
:Sulfer[N Rows( dtMax )] = Report( profile )["Prediction Profiler"][Number Edit Box( 3 )]
<< get;
);
回覆:最大化意願函數後提取輸出你好吉姆,
非常感謝您的代碼。然而,它在最後一部分給出了一個錯誤(在完成最小二乘擬合之後並在創建空表“意願”之後),如下所示:

我正在運行 JMP15。
回覆:最大化意願函數後提取輸出另外,我如何將與最大化需求相對應的最佳化反應(即磨損、模量、伸長率、硬度)保存到同一個表中?
謝謝。
回覆:最大化意願函數後提取輸出For Each() 函數直到 JMP 16 才引入。
For( i=1,i<=nitems(fm), i++,
以下是修改後的 JSL,以使用 For() 函數,並讀取響應變數的最佳化值。我在 JMP 15 中測試了程式碼
Names Default To Here( 1 );
dt =
// Open Data Table: Tiretread.jmp
// → Data Table( "Tiretread" )
Open( "$SAMPLE_DATA/Tiretread.jmp" );
dtSub = dt << subset( selected columns( 0 ), selected rows( 0 ), output table( "Subset" ) );
For Each Row(
:Abrasion = :Abrasion + :Abrasion*random normal(0,1);
:MODULUS = :MODULUS + :MODULUS*random normal(0,1);
:ELONG = :ELONG + :ELONG * random normal(0,1);
:HARDNESS = :HARDNESS + :HARDNESS* random normal(0,1);
);
dt << Concatenate(
dtSub,
Output Table( "Concat of Tiretread, Subset" ),
Append to first table,
Create source column
);
Close( dtSub, nosave );
// Run the Model
fm = Fit Model(
Y( :ABRASION, :MODULUS, :ELONG, :HARDNESS ),
By( :Source Table ),
Effects( :SILICA, :SILANE, :SULFUR ),
Personality( "Standard Least Squares" ),
Emphasis( "Effect Leverage" ),
Run(
:ABRASION << {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 )},
:MODULUS << {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 )},
:ELONG << {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 )},
:HARDNESS << {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 )},
Profiler(
1,
Confidence Intervals( 1 ),
Desirability Functions( 1 )
)
)
);
// Stop the JSL
stop();
// Set the Maximize Desirability and the run the code below
// Create an output table
dtMax = New Table( "Desirability",
New Column( "By Group", character ),
New Column( "Silica" ),
New Column( "Silane" ),
New Column( "Sulfer" ),
New Column( "Optimized Abrasion"),
New Column( "Optimized Modulus"),
New Column( "Optimized Elong"),
New Column( "Optimized Hardness")
);
// Populate the table getting the Desirability values from the chart
// In this example, the 2 by groups are actually just a replicate of the same
// data, so the output values will be the same.
For( i=1,i<=nitems(fm), i++,
dtMax << add rows( 1 );
:By Group[N Rows( dtMax )] = Report( fm[i] )[Outline Box( 1 )] << get title;
:Silica[N Rows( dtMax )] = Report( fm[i] )["Prediction Profiler"][Number Edit Box( 1 )]
<< get;
:Silane[N Rows( dtMax )] = Report( fm[i] )["Prediction Profiler"][Number Edit Box( 2 )]
<< get;
:Sulfer[N Rows( dtMax )] = Report( fm[i] )["Prediction Profiler"][Number Edit Box( 3 )]
<< get;
:Optimized Abrasion[N Rows( dtMax )] = Num(Report( fm[i] )["Prediction Profiler",TextBox(2)]
<<GET text=""></GET>
<P>現在你的工作來了。您需要研究提供的 JSL 並了解它的作用。在不了解程式碼用途的情況下剪下和貼上程式碼並不是一個好的做法。請花時間了解所使用的函數、顯示樹輸出以及如何解釋和使用輸出顯示中的值。當您遇到理解問題時,請返回討論社區尋求協助。</P>
<P> </P>