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

Script for saving residuals: Informative Names for Residuals Columns

I am using JMP Pro 15.2.1 to generate a series of progressively simpler split-plot models (specified as Mixed Models in the Fit Model window).

I have many response variables. For each of these I am generating 5 nested models . For a given response variable (for example "FinalYr5", in the attached JSL):

  • Random effects include randomized block (:Blk#) and whole plot randomized within block (:Name( "Whole plot" )[:Blk#]
  • Fixed effects include Insolation (Insoln), Moisture addition (Moist), and their interaction.

The 5 nested models include the following terms.  The first two are shown in the attached JSL

  • Insoln + Moist +Insoln * Moist [+Random effects]
  • Insoln + Moist [+Random effects]
  • Insoln [+Random effects]
  • Moist [+Random effects]
  • Null [Random effects]

To save Residuals (and the Prediction Formula) in the data table, I inserted those terms in the Run() statement. So far, so good. However, the columns automatically named in the data table, below, are not informative.

  • Residuals FinalYr5   [Insoln + Moist +Insoln * Moist]
  • Residuals FinalYr5 2 [Insoln + Moist]
  • Residuals FinalYr5 3 [Insoln]
  • Residuals FinalYr5 4 [Moist]
  • Residuals FinalYr5 5 [Null]

Question: Is there a scripting method to assign more meaningful names to the columns saved in the data table? For example, is there script that would allow me to assign names to columns to better reflect the model terms in brackets, above? (e.g., I+M+IxM, I+M,...)

 

 

	Fit Group(
Fit Model(
Y( :FinalYr5 ),
Effects( :Insoln, :Moist, :Insoln * :Moist ),
Random Effects( :Blk#, :Name( "Whole plot]" )[:Blk#] ),
NoBounds( 1 ),
Personality( "Mixed Model" ),
Run( Repeated Effects Covariance Parameter Estimates( 0 ), Residuals(1), Prediction Formula(1) ),
SendToReport(
Dispatch(
{},
"Actual by Conditional Predicted Plot",
OutlineBox,
{Close( 1 )}
),
Dispatch(
{},
"Fixed Effects Parameter Estimates",
OutlineBox,
{Close( 1 )}
)
)
),
Fit Model(
Y( :FinalYr5 ),
Effects( :Insoln, :Moist ),
Random Effects( :Blk#, :Name( "Whole plot" )[:Blk#] ),
NoBounds( 1 ),
Personality( "Mixed Model" ),
Run( Repeated Effects Covariance Parameter Estimates( 0 ), Residuals(1), Prediction Formula(1) ),
SendToReport(
Dispatch(
{},
"Actual by Conditional Predicted Plot",
OutlineBox,
{Close( 1 )}
),
Dispatch(
{},
"Fixed Effects Parameter Estimates",
OutlineBox,
{Close( 1 )}
)
)
),

 

 

2 REPLIES 2
Byron_JMP
Staff

Re: Script for saving residuals: Informative Names for Residuals Columns

go to Help>Scripting Index, and search for Set Name.

there is this simple example of how to change a column name via JSL

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
:Age << Set Name( "Time" );
JMP Systems Engineer, Health and Life Sciences (Pharma)
cbhalpern
Level III

Re: Script for saving residuals: Informative Names for Residuals Columns

Thank you.