JSL adding a constant categorical factor DoEUsing the DoE
I'd like to record constant categorical factors in a JSL script, but it seems that only constant continuous factors are properly saved and loaded.
While I can enter string values for a constant factor, when I generate the JSL script the string values are replaced with numeric.
E.g. if I enter constant factors "X1" and "X2" with values 99 and "a_string" respectively, the generated script is:
DOE(
Custom Design,
{
Add Response( Maximize, "Y", ., ., . ),
Add Factor( Constant, 99, "X1" ),
Add Factor( Constant, 1, "X2" ),
Set Random Seed( 1385290084 ),
Simulate Responses( 0 ),
Save X Matrix( 0 )
}
);i.e. my string value "a_string" has been replaced by 1.
Screenshot attached.
Does anyone know how I can get a constant categorical factor into a JSL script?
Automation and ScriptingRe: JSL adding a constant categorical factor DoESince you mention JSL, I assume that you already know about 'Help > Scripting Index'. Searching for 'doe' gives lots of info, usually with examples:

And there's the more extensive documentation too, of course.
But, to be clear, what I offered was a workaround to what appears to be a bug. So please do send an email to support@jmp.com and point them to this thread. That way it will be fixed.
Re: JSL adding a constant categorical factor DoEThanks!
That's brilliant.
Do you have a link to documentation that I might have found out how to do this?
Re: JSL adding a constant categorical factor DoEIt's a little circuitous, but this does it (JMP 15 on a Mac):
NamesDefaultToHere(1);
// Make a factor table
dt =
New Table( "My Factors",
Add Rows( 2 ),
New Table Variable( "Table Type", "DOE Factor Table" ),
New Column( "X1",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Property( "Design Role", Design Role( Constant ) ),
Set Property( "Factor Changes", Easy ),
Set Values( [99, .] )
),
New Column( "X2",
Character,
"Nominal",
Set Property( "Design Role", Design Role( Constant ) ),
Set Property( "Factor Changes", Easy ),
Set Values( {"a_string_value", ""} )
)
);
// Make a DOE object
myDOE =
DOE(
Custom Design,
{
Add Response( Maximize, "Y", ., ., . ),
Set Random Seed( 1385290084 ),
Simulate Responses( 0 ),
Save X Matrix( 0 )
}
);
// Load in the factors
myDOE << loadFactors(dt);
// Delete the factors
Close(dt, noSave);