스크립트를 사용하여 여러 개의 산점도를 테이블로 만들 수 있습니까?여러분 안녕하세요.
내가 만든이 스크립트를 사용하여 여러 개의 산점도를 테이블로 인쇄 할 수 있습니다.
Names Default To Here( 1 );
dt = Open( "$Sample_Data/Big Class.jmp" );
dt = Current Data Table();
For( i = 4, i <= N Cols( dt ), i++,
Column( dt, i ) << data type( numeric );
Column( dt, i ) << set modeling type( continuous );
);
address = Current Data Table();
Scatterplot Matrix(
Y(
:Column(address, 4),
:Column(address, 5)
),
X( :Column(address, 2) ),
Fit Line( 0 ),
SendToReport
(
Dispatch
(
{},
"1100",
ScaleBox,
{
Add Ref Line( :Column(address, 4)[2], "Solid", "Medium Dark Blue", "LSL", 1 ),
Add Ref Line( :Column(address, 4)[3], "Solid", "Medium Dark Blue", "USL", 1 )
}
),
Dispatch
(
{},
"1101",
ScaleBox,
{
Add Ref Line( :Column(address, 5)[2], "Solid", "Medium Dark Blue", "LSL", 1 ),
Add Ref Line( :Column(address, 5)[3], "Solid", "Medium Dark Blue", "USL", 1 )
}
),
Dispatch(
{},
"Scatterplot Matrix Plot",
FrameBox,
{Frame Size( 600, 200 )}
),
)
);
아래 스크립트와 같이 [for] 함수를 사용하려고했습니다.
Names Default To Here( 1 );
dt = Open( "$Sample_Data/Big Class.jmp" );
dt = Current Data Table();
For( i = 4, i <= N Cols( dt ), i++,
Column( dt, i ) << data type( numeric );
Column( dt, i ) << set modeling type( continuous );
);
address = Current Data Table();
For( i = 4, i <= 5, i++,
Scatterplot Matrix(
Y(
:Column(address, i)
),
X( :Column(address, 2) ),
Fit Line( 0 ),
SendToReport
(
Dispatch
(
{},
"1100",
ScaleBox,
{
Add Ref Line( :Column(address, i)[2], "Solid", "Medium Dark Blue", "LSL", 1 ),
Add Ref Line( :Column(address, i)[3], "Solid", "Medium Dark Blue", "USL", 1 )
}
),
Dispatch(
{},
"Scatterplot Matrix Plot",
FrameBox(i),
{Frame Size( 600, 200 )}
)
)
);
);
그러나 스크립트는 서로 그래프를 만들었습니다.
[for] 함수를 사용하여 테이블에 다중 분산을 만들 수 있도록 도와주세요 ... T ^ T
해석학데이터 테이블스크립팅Re : 스크립트를 사용하여 여러 개의 산점도를 테이블로 만들 수 있습니까?For () 루프를 사용하려는 위치에 대한 제안은 실제로 필요한 것은 아닙니다. 내가 당신을 올바르게 이해하고 있다면, 원하는 것은 여러 Y 열과 단일 x 열이있는 산점도 행렬을 생성하는 것입니다. 이렇게하려면 산점도 코드를 반복 할 필요가 없습니다. 실제로 필요한 것은 Y에 원하는 열 목록을 만든 다음 해당 목록을 연결하는 것입니다. 이제 각 그래프에 사양 제한을 추가하는 것과 관련하여 필요한 제한이있는 독립 테이블을 만든 다음 데이터 테이블에 제한을 복사하는 것이 좋습니다. 그런 다음 데이터가 처리되면 다양한 매트릭스에 한계가 자동으로 적용됩니다.
Names Default To Here( 1 );
dt = Open( "$Sample_Data/Blood pressure.jmp" );
// Create a list of all of the columns one wants for Y values in the
// scatterplot matrix
colNamesList = dt << get column names( continuous );
// Here is the limits table. This can be just a saved data table that is
// opened in the script. It does not have to be a table built in a script
dtLimits = New Table( "Limits",
Add Rows( 9 ),
New Column( "Variable",
Character,
"Nominal",
Set Values( {"BP 8M", "BP 12M", "BP 6M", "BP 8W", "BP 12W", "BP 6W", "BP 8F", "BP 12F", "BP 6F"} )
),
New Column( "LSL",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [175, 175, 175, 171, 173, 171, 172, 174, 172] )
),
New Column( "USL",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [180, 185, 185, 187, 190, 180, 185, 188, 186] )
),
New Column( "Target", Numeric, "Continuous", Format( "Best", 12 ), Set Values( [., ., ., ., ., ., ., ., .] ) ),
New Column( "Show Limits",
Numeric,
"Nominal",
Format( "Best", 12 ),
Set Values( [1, 1, 1, 1, 1, 1, 1, 1, 1] )
)
);
// Add the limits from the limits data table to the data table with the
// data values in it
For( i = 1, i <= N Rows( dtLimits ), i++,
Eval(
Substitute(
Expr(
Column( dt, dtLimits:Variable[i] ) << set property(
"spec limits",
{LSL( __LSL__ ), USL( __USL__ ), show limits( 1 )}
)
),
Expr( __LSL__ ), dtLimits:LSL[i],
Expr( __USL__ ), dtLimits:USL[i]
)
)
);
// Create the Scatterplot Matrix
dt << Scatterplot Matrix(
Y(
Eval( colNamesList )
),
X( :Column( dt, 2 ) ),
Fit Line( 0 ),
SendToReport( Dispatch( {}, "Scatterplot Matrix Plot", FrameBox, {Frame Size( 600, 200 )} ), )
);
Re : 스크립트를 사용하여 여러 개의 산점도를 테이블로 만들 수 있습니까?당신의 조언은 저에게 매우 도움이됩니다.
고맙습니다, 짐 박사!