最小二乗法に適合するforループこんにちは、
フィット最小二乗モデルから等高線図を取得しようとします。 そこで、因子の1つを変更してモデルを取得できるように、forループを生成します。
問題は、スクリプトを実行した後、すべてのグラフに同じ要素が表示されることです(Boule IDが異なると仮定します)。 生成したすべてのタブに最後のブールIDが表示されます。
names default to here (1);
dt = current data table ();
listID = {"108400", "108610", "109105", "109350", "109838", "109900", "109903", "109904",
"110397", "110422", "110423", "110939", "111167", "111206", "111309", "111704",
"112505", "113023", "113045", "113227", "113344", "113504", "115983", "116118",
"116489", "116490", "116534", "116609", "119687", "119849", "119852", "120478",
"120856", "121030", "121117", "121640"} ;
nw = new window ("Contour", tb = tab box(),my vlb = v list box());
for (i = 1, i<= n items (listID), i++,
tb << add (listID[i], my vlb = v list box());
my vlb<< append(obj = Fit Model(
Y( :Center_Median_BAPL ),
Effects(
:PLMedian & RS,
:Boule_Position & RS,
:Boule_Position * :Boule_Position,
:Boule_ID
),
Personality( "Standard Least Squares" ),
Emphasis( "Effect Leverage" ),
Run(
Profiler(
1,
Confidence Intervals( 1 ),
Term Value(
PLMedian( 925.7, Min( 908 ), Lock( 0 ), Show( 1 ) ),
Boule_Position( 0.82, Lock( 0 ), Show( 1 ) ),
Boule_ID( listID[i], Lock( 0 ), Show( 1 ) )
),
Simulator(
1,
Factors(
PLMedian << Fixed( 925.7 ),
Boule_Position << Fixed( 0.82 )
),
Responses( Center_Median_BAPL << No Noise )
),
Simulator( 0 )
),
Contour Profiler(
1,
Term Value(
PLMedian( 925.7, Min( 910 ), Max( 925 ), Lock( 0 ), Show( 1 ) ),
Boule_Position( 0.82, Lock( 0 ), Show( 1 ) ),
Boule_ID( listID[i], Lock( 0 ), Show( 1 ) )
),
Simulator(
1,
Factors(
PLMedian << Fixed( 925.7 ),
Boule_Position << Fixed( 0.82 )
),
Responses( Center_Median_BAPL << No Noise )
),
Simulator( 0 ),
Contour Value(
Center_Median_BAPL(
903.5,
Lo Limit( 901 ),
Hi Limit( 905 ),
Min( 893.5 ),
Max( 913.5 )
)
),
Grid Density( "40 x 40" ),
Contour Grid( 900, 910, 1, Center_Median_BAPL ),
Horizontal Factor( :Boule_Position ),
Vertical Factor( :PLMedian )
),
:Center_Median_BAPL << {Summary of Fit( 0 ), Analysis of Variance( 0),
Parameter Estimates( 0 ), Scaled Estimates( 0 ), EffectSummary(0),Lack Of Fit (0), Effect Tests(0), Prediction Profiler (0),
Plot Actual by Predicted( 0 ), Plot Regression( 0 ),
Plot Residual by Predicted( 0 ), Plot Studentized Residuals(0 ),
Plot Effect Leverage( 0 ), Plot Residual by Normal Quantiles( 0 ),
Box Cox Y Transformation( 0 ), Show VIF( 0)}
),
Local Data Filter(
Add Filter(
columns( :Boule_Position ),
Where( :Boule_Position >= 0.5992 & :Boule_Position <= 0.82 )
)
),
SendToReport(
Dispatch(
{"Response Center_Median_BAPL", "Contour Profiler"},
"1",
ScaleBox,
{Min( 0.5992 ), Max( 0.82 ), Inc( 0.02 ), Minor Ticks( 0 ),
Label Row( Show Major Grid( 1 ) )}
),
Dispatch(
{"Response Center_Median_BAPL", "Contour Profiler"},
"2",
ScaleBox,
{Min( 908 ), Max( 925 ), Inc( 1 ), Minor Ticks( 0 ),
Label Row( Show Major Grid( 1 ) )}
),
Dispatch(
{"Response Center_Median_BAPL", "Contour Profiler"},
"Contour Profiler Frame",
FrameBox,
{Frame Size( 513, 467 ), DispatchSeg(
Contour Seg( 4 ),
{Line Color( "None" ), Fill Color( {212, 73, 88} )}
)}
)
)
);
)
);
スクリプティングRe:最小二乗法に適合するforループ何が起こっているのかと思いますが、実行前にすべてのプラットフォームコードがVリストボックス()に追加されており、実行時に変数iの値がすべて同じであるため、変更しました追加が行われる前に、変数の正確な値に置き換えるコード。
それを試して、それが役立つかどうかを確認してください......分析のすべての詳細を含むデータテーブルがないため、コードをテストできませんでした。
Names Default To Here( 1 );
dt = Current Data Table();
listID = {"108400", "108610", "109105", "109350", "109838", "109900", "109903", "109904", "110397", "110422", "110423", "110939", "111167", "111206",
"111309", "111704", "112505", "113023", "113045", "113227", "113344", "113504", "115983", "116118", "116489", "116490", "116534", "116609", "119687",
"119849", "119852", "120478", "120856", "121030", "121117", "121640"};
nw = New Window( "Contour", tb = Tab Box(), my vlb = V List Box() );
For( i = 1, i <= N Items( listID ), i++,
tb << Add( listID[i], my vlb = V List Box() );
Eval(
Substitute(
Expr(
my vlb << append(
obj = Fit Model(
Y( :Center_Median_BAPL ),
Effects( :PLMedian & RS, :Boule_Position & RS, :Boule_Position * :Boule_Position, :Boule_ID ),
Personality( "Standard Least Squares" ),
Emphasis( "Effect Leverage" ),
Run(
Profiler(
1,
Confidence Intervals( 1 ),
Term Value(
PLMedian( 925.7, Min( 908 ), Lock( 0 ), Show( 1 ) ),
Boule_Position( 0.82, Lock( 0 ), Show( 1 ) ),
Boule_ID( __listID__, Lock( 0 ), Show( 1 ) )
),
Simulator(
1,
Factors(
PLMedian << Fixed( 925.7 ),
Boule_Position << Fixed( 0.82 )
),
Responses( Center_Median_BAPL << No Noise )
),
Simulator( 0 )
),
Contour Profiler(
1,
Term Value(
PLMedian( 925.7, Min( 910 ), Max( 925 ), Lock( 0 ), Show( 1 ) ),
Boule_Position( 0.82, Lock( 0 ), Show( 1 ) ),
Boule_ID( __listID__, Lock( 0 ), Show( 1 ) )
),
Simulator(
1,
Factors(
PLMedian << Fixed( 925.7 ),
Boule_Position << Fixed( 0.82 )
),
Responses( Center_Median_BAPL << No Noise )
),
Simulator( 0 ),
Contour Value( Center_Median_BAPL( 903.5, Lo Limit( 901 ), Hi Limit( 905 ), Min( 893.5 ), Max( 913.5 ) ) ),
Grid Density( "40 x 40" ),
Contour Grid( 900, 910, 1, Center_Median_BAPL ),
Horizontal Factor( :Boule_Position ),
Vertical Factor( :PLMedian )
),
:Center_Median_BAPL << {Summary of Fit( 0 ), Analysis of Variance( 0 ), Parameter Estimates( 0 ),
Scaled Estimates( 0 ), EffectSummary( 0 ), Lack Of Fit( 0 ), Effect Tests( 0 ), Prediction Profiler( 0 ),
Plot Actual by Predicted( 0 ), Plot Regression( 0 ), Plot Residual by Predicted( 0 ), Plot Studentized Residuals( 0 ),
Plot Effect Leverage( 0 ), Plot Residual by Normal Quantiles( 0 ), Box Cox Y Transformation( 0 ), Show VIF( 0 )}
),
Local Data Filter(
Add Filter( columns( :Boule_Position ), Where( :Boule_Position >= 0.5992 & :Boule_Position <= 0.82 ) )
),
SendToReport(
Dispatch(
{"Response Center_Median_BAPL", "Contour Profiler"},
"1",
ScaleBox,
{Min( 0.5992 ), Max( 0.82 ), Inc( 0.02 ), Minor Ticks( 0 ), Label Row( Show Major Grid( 1 ) )}
),
Dispatch(
{"Response Center_Median_BAPL", "Contour Profiler"},
"2",
ScaleBox,
{Min( 908 ), Max( 925 ), Inc( 1 ), Minor Ticks( 0 ), Label Row( Show Major Grid( 1 ) )}
),
Dispatch(
{"Response Center_Median_BAPL", "Contour Profiler"},
"Contour Profiler Frame",
FrameBox,
{Frame Size( 513, 467 ), DispatchSeg( Contour Seg( 4 ), {Line Color( "None" ), Fill Color( {212, 73, 88} )} )}
)
)
)
)
),
Expr( __ListID__ ), ListID[i]
)
);
);