BookmarkSubscribeRSS Feed
dstahlke

Community Trekker

Joined:

Sep 23, 2014

Why does Fit Model only work with current table?

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", <<On ),
     Emphasis( "Effect Screening", <<On ),
     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?

1 ACCEPTED SOLUTION

Accepted Solutions
michael_jmp

Staff

Joined:

Jun 23, 2011

Solution

Re: Why does Fit Model only work with current table?

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

);

Michael Crotty
Sr Statistical Writer
JMP Development
3 REPLIES
michael_jmp

Staff

Joined:

Jun 23, 2011

Solution

Re: Why does Fit Model only work with current table?

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

);

Michael Crotty
Sr Statistical Writer
JMP Development
dstahlke

Community Trekker

Joined:

Sep 23, 2014

Re: Why does Fit Model only work with current table?

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"?

michael_jmp

Staff

Joined:

Jun 23, 2011

Re: Why does Fit Model only work with current table?

Not that I know of. I generally just use the ":X" reference in platform scripts.

Michael Crotty
Sr Statistical Writer
JMP Development