cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
aliegner1
Level IV

extracting Linear Fit values? error

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]);

 

 

aliegner1_0-1666211889107.png

 

aliegner1_2-1666211930519.png

 

 

aliegner1_1-1666211901416.png

 

 

1 REPLY 1
jthi
Super User

Re: extracting Linear Fit values? error

Using Make Combined Data Table might be easier than navigating the report layer.

jthi_0-1666212542583.png

 

Using Big Class.jmp and Fit Y by X with selections like this:

jthi_1-1666212577769.png

Provides me with output:

jthi_2-1666212593104.png

 

When I right click on the Table Box inside Parameter Estimates and select "Make Combined Data Table" I get following table:

jthi_3-1666212626801.png

 

From there I can delete all rows and columns which I'm not interested in.

You can also get the script from table script

jthi_4-1666212656534.png

 

-Jarmo