- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
How to make expressions work in statements?
I used the loop to generate an expression factors() with the contents of the parentheses. But it doesn't work in DOE's data simulation statement.
fs = Expr(Factors(L1 << random(normal(0, 0.5)), L12 << random(normal(0, 0.5))) );
eval(evalexpr(dt << Profiler(
Y( :Y ),
Profiler(
1,
Simulator(
1,
Expr(fs),
Responses( Y << No Noise ),
N Runs( 1000000 ),
Resimulate
)
)
)));
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to make expressions work in statements?
In your profiler statement, you are telling JMP to evaluate the variable fs and place whatever is returned into the enclosing profiler launch expression. In this case, you need the evaluation of fs to return the expression. To see what fs returns when you evaluate it, you can highlight the variable and click the run button. When you do this, JMP will error because it is trying to evaluate the expression. That expression is not a valid JSL statement by itself.
In short, you do not want to evaluate the expression held by fs, you want to get the expression itself. To do this, use the NameExpr() function. Try this:
fs = Expr( Factors( L1 << random( normal( 0, 0.5 ) ), L12 << random( normal( 0, 0.5 ) ) ) );
Eval(
Eval Expr(
dt << Profiler(
Y( :Y ),
Profiler(
1,
Simulator(
1,
Expr( Name Expr( fs ) ),
Responses( Y << No Noise ),
N Runs( 1000000 ),
Resimulate
)
)
)
)
);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to make expressions work in statements?
In your profiler statement, you are telling JMP to evaluate the variable fs and place whatever is returned into the enclosing profiler launch expression. In this case, you need the evaluation of fs to return the expression. To see what fs returns when you evaluate it, you can highlight the variable and click the run button. When you do this, JMP will error because it is trying to evaluate the expression. That expression is not a valid JSL statement by itself.
In short, you do not want to evaluate the expression held by fs, you want to get the expression itself. To do this, use the NameExpr() function. Try this:
fs = Expr( Factors( L1 << random( normal( 0, 0.5 ) ), L12 << random( normal( 0, 0.5 ) ) ) );
Eval(
Eval Expr(
dt << Profiler(
Y( :Y ),
Profiler(
1,
Simulator(
1,
Expr( Name Expr( fs ) ),
Responses( Y << No Noise ),
N Runs( 1000000 ),
Resimulate
)
)
)
)
);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to make expressions work in statements?
Thanks for the quick answer, many thanks!
This post originally written in Chinese (Simplified) and has been translated for your convenience. When you reply, it will also be translated back to Chinese (Simplified).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to make expressions work in statements?
I don't know why, but none of the code after Expr( Name Expr( fs ) ) works. Can you help me look at it? For example, N Runs( 1000000 )
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to make expressions work in statements?
If you are still having the problem, I'll be happy to look at it. Can you post the data table you are using?