从Fit Special中提取坡度我有两个变量X和Y,它们将y拟合为直线-截距限制为0。
我需要从这条线的斜率值进行后续计算。
无论如何,是否将此斜率值保存在列中,以便我可以将其用于后续计算。
双变量
Y(:Y),
X(:X),
适合特殊(拦截(0),
数据表脚本编写回复:从Fit Special中提取斜率如果您只是想在交互工作时查找系数,则可以查看双变量拟合平台内的“参数估计”表。如果要使用脚本将其导出,则有几种选择,一种是将Parameter Estimates表转换为数据表并从那里获取它:

Names Default To Here( 1 );
//Sample data
dt = Open("$Sample_data/iris.jmp");
//Fit line
bv = dt << Bivariate(
Y( :Sepal length ),
X( :Sepal width ),
Fit Special( Intercept( 0 ), {Line Color( {212, 73, 88} )} )
);
Wait( 0 );
//Save estimates to a table
dtEstimates = Report( bv )[Outline Box( "Bivariate Fit of Sepal length By Sepal width" )][
Outline Box( "Linear Fit" )][Outline Box( "Parameter Estimates" )][Table Box( 1 )]
<< Make Into Data Table;
// Pull estimate out of data table
dtEstimates:Estimate[dtEstimates << Get Rows Where(:Term == "Sepal width")][1];
// Clean up
// Report( bv ) << Close Window;
// dtEstimates << Close Window;