그룹화 변수를 사용하여 이변수 플롯에 사양을 입력하는 데 도움이 됩니다.
안녕하세요,
제가 하려는 일의 예로 Big Class를 사용하겠습니다.나이와 성별을 BY 변수로 사용하여 체중(Y) 대 키(X)를 플롯하려고 한다고 가정해 보겠습니다.하지만 제 경우에는 BY 변수가 몇 수준을 가질지 예측할 수 없습니다.각 이변량 플롯에 대해 선을 맞춥니다."키"의 하한 및 상한 규격 한계에 수직 참조선을 추가하고 "체중"의 하한 및 상한 규격 한계에 수평 참조선을 추가하려고 합니다.표의 열에 이러한 규격 한계 값이 있습니다.나이와 성별의 각 조합 내에서 규격 한계는 일정하지만(행마다 다르지 않음) 이러한 조합 간에는 규격 한계가 다릅니다.JMP 18에서 어떻게 이 작업을 수행할 수 있습니까?
</CODE></PRE>
<P>필요한 모든 값을 담은 요약 표를 만드는 게 어떨까 생각했습니다.</P>
<BR />
<BR />
<PRE><CODE class=" language-jsl">dt = Data Table( "Big Class" );
rep=Bivariate(
SendToByGroup( Bygroup Default ),
Y( :weight ),
X( :height ),
Fit Line(
{Confid Curves Fit( 1 ), Confid Shaded Fit( 1 ), Line Color( {212, 73, 88} )
}
),
By( :age, :sex ),
);
summary = dt << Summary(
Group( :age, :sex, :LSL_Height,:USL_Height,:LSL_Weight,:USL_Weight ),
Freq( "None" ),
Weight( "None" ),
output table name( "Summary of Big Class grouped by age, sex" )
);
불행히도 이것은 작동하지 않습니다:
for (i=1,i<= n rows(summary), i++,
rep << EVAL(SendToByGroup(
{:age == eval(age[i]), :sex == eval(sex[i])},
SendToReport(
Dispatch( {}, "height", ScaleBox,
{Add Ref Line( eval(LSL_Height[i]), "Solid", "Red", "", 1 ),
Add Ref Line( eval(uSL_Height[i]), "Solid", "Red", "", 1 )
}
)
),
SendToReport(
Dispatch( {}, "Weight", ScaleBox,
{Add Ref Line( eval(LSL_Weight[i]), "Solid", "Black", "", 1 ),
Add Ref Line( eval(uSL_Weight[i]), "Solid", "Black", "", 1 )
}
)
),
);
)
);
감사합니다
자동화 및 스크립팅Re: 그룹화 변수를 사용하여 이변수 플롯에 사양을 입력하는 데 도움이 됩니다.축은 참조선을 기준으로 자동 크기 조정되지 않는다는 점에 유의하세요.
Names Default To Here(1);
dt = open("$SAMPLE_DATA/Big Class.jmp");
dt_specs = dt << Summary(
Group(:sex),
Quantiles(25, :height),
Quantiles(25, :weight),
Quantiles(75, :height),
Quantiles(75, :weight),
Freq("None"),
Weight("None"),
Link to original data table(0),
output table name("spec limits by sex")
);
Column(dt_specs, "Quantiles25(height)") << Set Name("LSL_Height");
Column(dt_specs, "Quantiles25(weight)") << Set Name("LSL_Weight");
Column(dt_specs, "Quantiles75(height)") << Set Name("USL_Height");
Column(dt_specs, "Quantiles75(weight)") << Set Name("USL_Weight");
bivs = dt << Bivariate(
SendToByGroup(Bygroup Default),
Y(:weight),
X(:height),
Fit Line({Confid Curves Fit(1), Confid Shaded Fit(1), Line Color({212, 73, 88})}),
By(:age, :sex),
Group Options(Return Group(0)) // makes this easier but can slighlty complicate other things
);
For Each({biv}, bivs,
rep = Report(biv);
biv_title = rep << get title;
cur_age = Word(-1, biv_title, "=");
spec_row = dt_specs << Get Rows Where(:sex == cur_age);
// X-Axis
rep[AxisBox(2)] << Add Ref Line(dt_specs[spec_row, "LSL_Height"][1], "Dashed", blue, "LSL", 2);
rep[AxisBox(2)] << Add Ref Line(dt_specs[spec_row, "USL_Height"][1], "Dashed", blue, "USL", 2);
// Y-Axis
rep[AxisBox(1)] << Add Ref Line(dt_specs[spec_row, "LSL_Weight"][1], "Dashed", blue, "LSL", 2);
rep[AxisBox(1)] << Add Ref Line(dt_specs[spec_row, "USL_Weight"][1], "Dashed", blue, "USL", 2);
);
Re: 그룹화 변수를 사용하여 이변수 플롯에 사양을 입력하는 데 도움이 됩니다.출력 디스플레이를 수정하기 위해 이 방법을 사용하는 것이 더 편리하다고 생각합니다.

Names Default To Here( 1 );
dt = Data Table( "Big Class_withSpecs" );
rep = dt << Bivariate(
SendToByGroup( Bygroup Default ),
Y( :weight ),
X( :height ),
Fit Line( {Confid Curves Fit( 1 ), Confid Shaded Fit( 1 ), Line Color( {212, 73, 88} )} ),
By( :age, :sex ),
);
summary = dt << Summary(
Group( :age, :sex, :LSL_Height,:USL_Height,:LSL_Weight,:USL_Weight ),
Freq( "None" ),
Weight( "None" ),
output table name( "Summary of Big Class grouped by age, sex" )
);
For( i = 1, i <= N Rows( summary ), i++,
// There is a separate output display for each by group
// Set the report to modify
reprpt = report(rep[i]);
// For each report AxisBox(1) is the Y axis and AxisBox(2) is the X axis
reprpt[AxisBox(1)] << add Ref Line(summary:LSL_Weight[i], "Solid","Red", "", 1 );
reprpt[AxisBox(1)] << add Ref Line(summary:USL_Weight[i], "Solid","Red", "", 1 );
reprpt[AxisBox(2)] << add Ref Line(summary:LSL_Height[i], "Solid","Red", "", 1 );
reprpt[AxisBox(2)] << add Ref Line(summary:USL_Height[i], "Solid","Red", "", 1 );
);