軸から特定の値までの基準線ソフトカーブ上の x 軸の指定された値からの y 軸の予測値を示すグラフをスクリプト化しようとしています。 予測式を導き出し、基準線を定義するための関連値を取得することができました。 ただし、これを効果的に伝えるために、基準線は曲線で停止し、破線にすることが望ましいと思います。 上の画像は、私が JSL スクリプトで実行できた限りのものです。 以下で終わりにしたいと思います。
ありがとう!


Re: 軸から特定の値までの基準線これは本当にクールに見えますが、おそらく私の現在の理解レベルを少し上回っています。 私はあなたの例を参考にして自分なりの方法で取り組んでいき、その過程でかなりのことを学ぶことができれば幸いです。
Re: 軸から特定の値までの基準線ありがとうございます、まさにこれが私が探していたものでした!
Re: 軸から特定の値までの基準線以下のコードを使用すると、入力が 1 つだけ含まれる保存された数式列を動的にプロファイルできるようになります。 「ビッグクラス」と 4 次モデルの場合、次のようになります。

多かれ少なかれテストされていません。
NamesDefaultToHere(1);
// Function to find leaves in formula that are columns in the table
// See: https://community.jmp.com/blogs/Uncharted/2015/04/03/head-arg-recurse-formula"
// Thanks to Craige Hales
findColumns =
Function( {frm, cols},
{h = Head( frm ), n = N Arg( frm ), i, result = {}}, // local variables
If( n == 0, // head node has no children, it is a leaf
If( Contains( cols, Name Expr( h ) ), // is the leaf in the list of columns?
Insert Into( result, Name Expr( h ) ); // yes -> add to result
)
,
For( i = 1, i <= n, i++, // not a leaf, get children's results
Insert Into( result, Recurse( Arg( frm, i ), cols ) )
)
);
result; // return the result
);
// Open a table to play with, and add a formula column to it
dt = Open("$SAMPLE_DATA/Big Class.jmp");
fCol = dt << New Column( "Predicted weight",
Formula(-127 + 4 * :height),
Set Property("Predicting", {:weight, Creator( "Bivariate" ), Model Name( "Polynomial Fit Degree=3" )})
);
// Recover the required information
f = fCol << getFormula;
xColList = findColumns(NameExpr(f), dt << getColumnNames);
yCol = fCol << getProperty("Predicting");
yCol = yCol[1];
// Subsequent code will only work with one x Column
xCol = Expr(xColList[1]);
for(c=1, c<=NItems(xColList), c++, Print(c); if(xColList[c] != xCol, Print("Only one x Column allowed."); Beep(); Throw()));
// Reparameterise the formula for later use in the 'GraphBox()'
SubstituteInto(f, xCol, Expr(x));
// Set the initial 'VLine()' value to the mean of the x values
xVals = xCol << getValues;
x = Mean(xVals);
// Get 'reasonable' ranges for the axes
xMin = Min(xVals);
xMax = Max(xVals);
yMin = Min(yCol << getValues);
yMax = Max(yCol << getValues);
// Get the names of the columns involved
xColName = xCol << getName;
yColName = yCol << getName;
// Plot the graph
NewWindow("Function Profile",
gb = GraphBox("Simple Profiler", XScale(xMin, xMax), YScale(yMin, yMax), XName(xColName), yName(yColName),
// Plot the function
PenColor("Red"); YFunction(f, x);
// Handle to drag the 'VLine()' and update display
Handle(x, yMin + (yMax-yMin)/10, gb << reShow, Empty());
// Get the function value for the current x value
yy = Eval(Substitute(NameExpr(f), Expr(x), x));
// Plot the lines at the new places
PenColor("Blue"); LineStyle("Dotted");
VLine(x, yMin, yy);
HLine(xMin, x, yy);
);
);Re: 軸から特定の値までの基準線追加する@MikeD_Andersonプラットフォームのグラフにグラフィックを追加するコードを開発する最も簡単な方法は、問題のグラフを右クリックして「カスタム」を選択することです。これにより、リアルタイムでグラフを変更したり、グラフに追加したりすることができます。次に、「+」をクリックして新しいセグメントを追加します。

テンプレートまたはサンプルの使用、またはスクリプト エディタの「グラフィック カテゴリ」の使用

欲しいものが見つかるまでディスプレイをいじることができます。

赤い三角形に移動してスクリプトを保存できます。

これにより、サンプル スクリプトが得られます。これを変更してスクリプトを汎用化できます。
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA\big class.jmp" );
Bivariate(
Y( :height ),
X( :age ),
Fit Polynomial( 2, {Line Color( {213, 72, 87} )} ),
SendToReport(
Dispatch(
{},
"Bivar Plot",
FrameBox,
{Add Graphics Script(
2,
Description( "Script" ),
Line Style( dashed );
Line( [0, 13.35, 13.35], [62, 62, 50] );
), Grid Line Order( 1 ), Reference Line Order( 3 )}
)
)
);
Re: 軸から特定の値までの基準線軸から 2 本の参照線を使用する代わりに、グラフィックス スクリプトを使用してグラフ ボックスに四角形を描画してみてください。
Names Default To Here( 1 );
New Window( "Example",
Graph Box(
// line color
Pen Color( "Green" );
// line width
Pen Size( 2 );
// line style (dashed)
Line Style (2);
Fill Color( "Red" );
// filled rectangle
Rect( 15, 75, 65, 55, 1 );
// unfilled rectangle (reference lines)
Rect( -1, 80, 70, -1 );
)
);
M