최소 제곱 맞춤을위한 For 루프안녕하세요,
최소 제곱 모델에서 등고선도를 얻으려고합니다. 그래서 저는 for 루프를 생성하여 요인 중 하나를 변경하여 모델을 얻을 수 있습니다.
문제는 스크립트를 실행 한 후 모든 차트가 동일한 요소를 표시한다는 것입니다 (Boule ID를 변경한다고 가정). 내가 생성 한 모든 탭에 마지막 Boule 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 List Box ()에 추가되고 실행될 때 변수 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]
)
);
);