cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
JMP is taking Discovery online, April 16 and 18. Register today and join us for interactive sessions featuring popular presentation topics, networking, and discussions with the experts.
Choose Language Hide Translation Bar
gtchbe2019
Level I

Making a data table from Least Square Mean Table in Fit Model

I am trying to write a script that takes a data table, runs a fit model analysis based on several construct model effects, and then creates a data table from the least squares means table, specifically for the strain_id input. Below is the script I am currently using to run the fit model on my data but I am not sure how to extract the least squares means table. The only way I know how to do this is to right click on the data from the fit model report and click the "make into a data table option." Could someone please explain how to do this same thing with a JSL script? Thank you. 

 

fm = Data Table( dt_pv ) << Fit Model(
	Y( :assay_main_prod ),
	Effects( :strain_id, :experiment_id, :main_plate_id ),
	Personality( Standard Least Squares ),
	Emphasis( Effect Leverage ),
	Run( Residuals( 1 ) )
);
1 ACCEPTED SOLUTION

Accepted Solutions
txnelson
Super User

Re: Making a data table from Least Square Mean Table in Fit Model

The details on how to maneuver around the Display Trees of the output, is documented in the Scripting Guide.  But basically, the Report Output from the various platforms is a structure of display objects that can be referenced by name and/or location and to have messages passed to them.  Below is a Fit Model close to what you are asking for, that runs the model and then goes to the Least Squares Means Table of your choice and tells it to Create Data Table.

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
fm = dt << Fit Model(
	Y( :weight ),
	Effects( :age, :sex ),
	Personality( Standard Least Squares ),
	Emphasis( Effect Leverage ),
	Run( Residuals( 1 ) )
);

Report( fm )["age"]["Least Squares Means Table"][Table Box( 1 )] << make data table;
Jim

View solution in original post

1 REPLY 1
txnelson
Super User

Re: Making a data table from Least Square Mean Table in Fit Model

The details on how to maneuver around the Display Trees of the output, is documented in the Scripting Guide.  But basically, the Report Output from the various platforms is a structure of display objects that can be referenced by name and/or location and to have messages passed to them.  Below is a Fit Model close to what you are asking for, that runs the model and then goes to the Least Squares Means Table of your choice and tells it to Create Data Table.

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/big class.jmp" );
fm = dt << Fit Model(
	Y( :weight ),
	Effects( :age, :sex ),
	Personality( Standard Least Squares ),
	Emphasis( Effect Leverage ),
	Run( Residuals( 1 ) )
);

Report( fm )["age"]["Least Squares Means Table"][Table Box( 1 )] << make data table;
Jim