Subscribe Bookmark RSS Feed

JMP Pro 11 Fit Model with list in JSL

kaylesawyer

Community Trekker

Joined:

Nov 12, 2013

Hi all,

I was trying to loop through a series of x variables ("Effects") for Fit Model, and came across this confusing behavior. When I create a list and use it with the Oneway platform, it behaves as expected. However, when I try the same thing with Fit Model, it seems to ignore my list and select variables based upon dt column order. I think this example code will make the issue more clear.

How do I specify an item from a list for an Effect within Fit Model?

data = Open ("$SAMPLE_DATA/Big Class.jmp");

x_list = {

  :sex,

  :height

};

data << Oneway(

  Y( :height ),

  X( x_list [1] )

);

data << Fit Model(

  Y( :height ),

  Effects( x_list [1] ),

  Personality( Standard Least Squares ),

  Emphasis( Effect Leverage ),

  Run(

  :height << {Lack of Fit( 0 )}

  )

);

1 ACCEPTED SOLUTION

Accepted Solutions
mpb

Super User

Joined:

Jun 23, 2011

Solution

See if either of these does what you want:

eval(x_list [1])


or


eval(x_list)

2 REPLIES
mpb

Super User

Joined:

Jun 23, 2011

Solution

See if either of these does what you want:

eval(x_list [1])


or


eval(x_list)

kaylesawyer

Community Trekker

Joined:

Nov 12, 2013

Thank you mpb! The eval() command worked (as below).


data << Fit Model(

  Y( :height ),

  Effects( eval ( x_list [1] )),

  Personality( Standard Least Squares ),

  Emphasis( Effect Leverage ),

  Run(

  :height << {Lack of Fit( 0 )}

  )

);