我對此有一些問題,在嘗試提取線性擬合參數時不斷出錯。
我有一個標準的 YvsX 數據集,但有 4 個不同的“分組依據”列。 當我嘗試進行提取時(我嘗試了很多不同的方法),我不斷收到這樣的錯誤:
任何想法這是怎麼回事? 我已經嘗試將四個列連接到一個列中,然後通過該單個連接進行拆分,但仍然會出現錯誤。
//make report
biv = Bivariate(
Y( :Y ),
X( :X ),
By( :A, :B, :C, :D</img> ),
Fit Line( {Line Color( "Red" )} )
);
//list the reports
rbiv = biv << report;
//count the number of reports
nBy = N Items( rbiv );
//array of as many rows as reports. 1col, all set to zero.
vc = J( nBy, 1, 0 );
//Create output table and fill with estimates
dtOut = New Table( "Regression parameters",
New Column( "Group", Character ),
New Column( "Intercept", numeric ),
New Column( "Slope", numeric ),
addrows( nBy ));
//grab the values
For( j = 1, j <= nBy, j++,
Estimates = rbiv[j]["Linear Fit"]["Parameter Estimates"][1][3] << get as matrix;
:Group[j] = groups[j];
:Intercept[j] = Estimates[1];
:Slope[j] = Estimates[2]);


