I'm having some issues with this, I keep getting errors when trying to pull out the linear fit parameters.
I've got a standard YvsX dataset, but with 4 different 'group by' columns. When I try to do the extraction (I've tried a lot of different methods), i keep getting errors like this:
Any Idea what's up with this? I've tried concatting the four cols into a single column and then splitting by that single concat and still get errors.
//make report
biv = Bivariate(
Y( :Y ),
X( :X ),
By( :A, :B, :C, ),
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]);