turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- JMP User Community
- :
- Discussions
- :
- Fit together / Fit separately (Fit Model)

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Feb 24, 2016 7:50 AM
(3099 views)

Hello everyone,

I would like to find a way, using JSL, to precise if I want to "fit separately" or "fit together" when there is missing values different across Y columns.

The following script enables to fit separately:

Fit Group(

Fit Model(

Y( :Y1 ),

Effects( :X ),

Personality( "Standard Least Squares" ),

Emphasis( "Effect Leverage" ),

Run()

),

Fit Model(

Y( :Y2 ),

Effects( :X ),

Personality( "Standard Least Squares" ),

Emphasis( "Effect Leverage" ),

Run()

)

);

And this one to fit together:

Fit Model(

Y( :Y1, :Y2 ),

Effects( :X ),

Personality( "Standard Least Squares" ),

Emphasis( "Effect Leverage" ),

Run()

);

But my problem is that I need to use the Fit Model function, after cliking on a button.

If I insert the previous script in a Button Box it does not work properly and I do not understand why:

new window("test",bb=button box("Fit Model"));

bb<<set function(

Fit Model(

Y( :Y1, :Y2 ),

Effects( :X ),

Personality( "Standard Least Squares" ),

Emphasis( "Effect Leverage" ),

Run()

)

);

When I click on the button, JMP opens the window to ask the user if he want to fit separately or fit together, instead of directly fitting together.

Do you have an idea of how I could fix this ?

Thanks in advance.

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Feb 25, 2016 4:16 AM
(5666 views)

Solution

It is strange and it may be a bug.

As a workaround, try a where-clause:

bb1 << **set function****(** New Window**(**"Fit Model Together",

Fit Model**(**

Y**(**:height, :weight**)**,

Effects**(**:sex**)**,

Personality**(**"Standard Least Squares"**)**,

Emphasis**(**"Effect Leverage"**)**,

where**(**!Is Missing**(**:height**)** & !Is Missing**(**:weight**))**,

Run**()**

**)**

**)**

**)**;

6 REPLIES

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Feb 25, 2016 2:02 AM
(2833 views)

Yes, I see the effect too (JMP 12.1 on the Mac).

If you press the 'Together' button, JMP tries to be helpful and pops up this:

but, if you run the code behind the button directly it doesn't (which is the desired behaviour). No good idea how to stop this, unfortunately. Please mail support@jmp.com and reference this thread.

Names Default To Here**(** **1** **)**;

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

// Decimate the responses a little to make a difference between the fits

Column**(**dt, "height"**)[**RandomIndex**(**NRow**(**dt**)**, **10****)]** = **.**;

Column**(**dt, "weight"**)[**RandomIndex**(**NRow**(**dt**)**, **10****)]** = **.**;

New Window**(** "test", bb1 = Button Box**(** "Fit Model Together" **)**, bb2 = Button Box**(** "Fit Model Separately" **)** **)**;

bb1 << **set function****(**

NewWindow**(**"Fit Model Together",

Fit Model**(**

Y**(** :height, :weight **)**,

Effects**(** :sex **)**,

Personality**(** "Standard Least Squares" **)**,

Emphasis**(** "Effect Leverage" **)**,

Run**()**

**)**

**)**

**)**;

bb2 << **set function****(**

NewWindow**(**"Fit Model Separately",

Fit Model**(**

Y**(** :height**)**,

Effects**(** :sex **)**,

Personality**(** "Standard Least Squares" **)**,

Emphasis**(** "Effect Leverage" **)**,

Run**()**

**)**,

Fit Model**(**

Y**(** :weight**)**,

Effects**(** :sex **)**,

Personality**(** "Standard Least Squares" **)**,

Emphasis**(** "Effect Leverage" **)**,

Run**()**

**)**

**)**

**)**;

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Feb 25, 2016 2:44 AM
(2833 views)

Just want to add that the pop-up is suppressed if *Fit Model* is explicitly told to fit separately.

bb1 << **set function****(**

NewWindow**(**"Fit Model Together",

Fit Model**(**

Y**(** :height, :weight **)**,

Effects**(** :sex **)**,

Personality**(** "Standard Least Squares" **)**,

Emphasis**(** "Effect Leverage" **)**,

** Run(****"Fit Separately"****)**

**)**

**)**

**)**;

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Feb 25, 2016 2:55 AM
(2833 views)

Indeed it works easily and perfectly with "Fit Separately", thanks !

Unfortunately I have tried with "Fit Together" and the pop-up still appears. Is there another way to precise explicitly that we want to fit together?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Feb 25, 2016 4:16 AM
(5667 views)

It is strange and it may be a bug.

As a workaround, try a where-clause:

bb1 << **set function****(** New Window**(**"Fit Model Together",

Fit Model**(**

Y**(**:height, :weight**)**,

Effects**(**:sex**)**,

Personality**(**"Standard Least Squares"**)**,

Emphasis**(**"Effect Leverage"**)**,

where**(**!Is Missing**(**:height**)** & !Is Missing**(**:weight**))**,

Run**()**

**)**

**)**

**)**;

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Feb 25, 2016 4:52 AM
(2833 views)

Thanks a lot! I wouldn't have thought using a where clause right here.

Furthermore I have just found an other interesting discussion:

Re: A JSL scripting question: JMP alert Please select the rows to be deleted

Using the option *Batch interactive* seems to fix the problem as well.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Feb 25, 2016 5:21 AM
(2833 views)