<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />I am new to jmp and jsl and unable to understand why the code below produces an error.
dt = open("simple.csv");
xyz = New Table("xyz", invisible);
//Current Data Table(dt);
fm = Fit Model(
Y(dt:X),
Effects(dt:Y),
Personality(Standard Least Squares),
Run Model,
Invisible
);
Print(fm);
Close(xyz);
Close(dt);
This produces the following error:
Cannot run without Y Responses
Specified Column not found in data table.{1} in access or evaluation of 'List' , {dt:X}Column not Found{1} in access or evaluation of 'dt:Y' , dt:Y
In the following script, error marked by /*###*/
Fit Model(
Method( "EMS", < Emphasis( "Effect Screening", < Keep dialog open( 1 ),
Y( dt:X ),
Effects( dt:Y ),
Personality( Standard Least Squares ),
Run Model,
Invisible
)
Model Dialog[]
However, if I don't create the xyz table, or if I close it before doing Fit Model, or if I uncomment the Current Data Table(dt), then it works. So it would seem that Fit Model can only operate on the current table. Is this a bug in jmp or am I missing something?
Not that I know of. I generally just use the ":X" reference in platform scripts.
Okay, thanks! So, given that platforms operate only on the current table, is there any point to referring to the columns as "dt:X" rather than just ":X"?
Platforms generally work on the current data table. However, you can make your script more robust by using the Send operator (<<) to explicitly state which table the platform call should apply to:
dt = open("simple.csv");
xyz = New Table("xyz", invisible);
//Current Data Table(dt);
fm = dt << Fit Model(
Y(dt:X),
Effects(dt:Y),
Personality(Standard Least Squares),
Run Model,
Invisible
);