Let's say that I have the following:
colList = {"Day","Sample[Day]", "Subsample[Sample,Day]"};
And I would like to use this colList above to populate the Effects of a Fit Model:
myModel = Fit Model(
Y( :Response ),
Effects( ????? ),
//....other stuff after this
);
I've tried a couple of things, and haven't had any success.
If I just have one column that doesn't have any nesting, and I set singleColName = colList[1], then I can get it to work by doing this:
Effects(Eval(Column(dt, singleColName)));
But the full list, and the nesting in particular, is causing all kinds of headaches (i.e., I've tried converting the list of column names into a list of column references, but the nesting doesn't play well with this approach).
Thanks!
@txnelson wrote:
When I have issues with getting the JMP functions to resolve to what I need, I will drop back to creating a literal string of exactly the code I want and then Eval(Parse()) the literal string. </CODE></P>
<HR /></BLOCKQUOTE>
<P> </P>
<P>Thank you, this is a valuable approach. Helped me many times.</P>
<P> </P></LINGO-BODY><LINGO-SUB id="lingo-sub-35372" slang="en-US">Re: JSL: Populate Fit Model's "Effects" with a List of columns (some with nesting)</LINGO-SUB><LINGO-BODY id="lingo-body-35372" slang="en-US"><P>When I have issues with getting the JMP functions to resolve to what I need, I will drop back to creating a literal string of exactly the code I want and then Eval(Parse()) the literal string. Here is an example similar to what you need to do:</P>
<PRE><CODE class=" language-jsl">dt = Open( "$SAMPLE_DATA\semiconductor capability.jmp" );
colList = {":Lot_ID", ":lot_id[:Wafer ID in lot ID]"};
value = collist[1];
For( i = 2, i <= N Items( collist ), i++,
value = value || "," || collist[i]
);
Eval(
Parse(
"myModel = Fit Model(
Y( :PNP1 ),
Effects( " || Value ||
" ),
Personality( \!"Standard Least Squares\!" )
);"
)
);