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
)
)
)));
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
)
)
)
)
);
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
)
)
)
)
);
谢谢你的快速回答,many thanks!
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 )
If you are still having the problem, I'll be happy to look at it. Can you post the data table you are using?