グループ化変数を使用した二変量プロットに仕様を配置するヘルプ
こんにちは、
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 );
);