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
- :
- Discussions
- :
- Saving the prediction formula to an existing column?

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

Highlighted
##

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

Saving the prediction formula to an existing column?

Feb 18, 2009 6:38 PM
(5284 views)

Hi,

I'm a new JMP user. I have several prediction formula saved to columns, and other columns linked to those. Now I want to update the formulas (many) in the original prediction columns with the new regression formula. Saving the prediction formula seems only possible to a new appended column. I suppose I could copy the formula from the new column and paste into the original column, but it's tedious. Perhaps the whole thing can be scripted, like excel's macro recorder??

Anyway, thanks in advance :)

Dave

I'm a new JMP user. I have several prediction formula saved to columns, and other columns linked to those. Now I want to update the formulas (many) in the original prediction columns with the new regression formula. Saving the prediction formula seems only possible to a new appended column. I suppose I could copy the formula from the new column and paste into the original column, but it's tedious. Perhaps the whole thing can be scripted, like excel's macro recorder??

Anyway, thanks in advance :)

Dave

11 REPLIES 11

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

Re: Saving the prediction formula to an existing column?

It can be scripted with JSL, but there's nothing like a macro recorder for tasks like that. You could do something like the following:

f = column("prednew") << Get Formula;

column("predold") << Set Formula( Name Expr( f ));

Message was edited by: xan@jmp

f = column("prednew") << Get Formula;

column("predold") << Set Formula( Name Expr( f ));

Message was edited by: xan@jmp

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

Re: Saving the prediction formula to an existing column?

Where would I put that code? Does it work on the newest added column, or a column of a particular name?

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

Re: Saving the prediction formula to an existing column?

Put it in a script window and run it. Save it as a JSL file it you need it often. The given code has the column names built in. If you want the last column as the source, replace "prednew" with NCol().

Note I fixed an error in my previous post by adding Name Expr() to make sure the formula is not evaluated*before *it is added to the new column.

Note I fixed an error in my previous post by adding Name Expr() to make sure the formula is not evaluated

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

Re: Saving the prediction formula to an existing column?

Thanks.

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

Re: Saving the prediction formula to an existing column?

Hi,

Do you know how I can get the script to put the formula into a file as plain text?

Very appreciated,

Dave

Do you know how I can get the script to put the formula into a file as plain text?

Very appreciated,

Dave

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

Re: Saving the prediction formula to an existing column?

Once you have the formula in a column, you can get it out, convert it to text, and then save it in a file.

f = Column( "saved formula col" ) << get formula;

t = Char( Name Expr( f ));

Save Text File( "myformula.txt", t );

f = Column( "saved formula col" ) << get formula;

t = Char( Name Expr( f ));

Save Text File( "myformula.txt", t );

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

Re: Saving the prediction formula to an existing column?

Silly question, maybe, but...

How do I save a negative of the formula? i.e. formula * -1 ?

How do I save a negative of the formula? i.e. formula * -1 ?

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

Re: Saving the prediction formula to an existing column?

one more question...how do I concatenate formulas into the single file?

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

Re: Saving the prediction formula to an existing column?

oncatenation of all formula seem to work like this:

t = "";

f = Column( "Pred Formula neg MxBmin" ) << get formula;

a = Char( Name Expr( f ));

t = Concat(t, a);

t = concat(t, "\!N");

t = concat(t, "\!N");

f = Column( "Pred Formula MxBmin" ) << get formula;

a = Char( Name Expr( f ));

t = Concat(t, a);

t = concat(t, "\!N");

t = concat(t, "\!N");

f = Column( "Pred Formula MxBmax" ) << get formula;

a = Char( Name Expr( f ));

t = Concat(t, a);

t = concat(t, "\!N");

t = concat(t, "\!N");

f = Column( "Pred Formula MrB" ) << get formula;

a = Char( Name Expr( f ));

t = Concat(t, a);

t = concat(t, "\!N");

t = concat(t, "\!N");

f = Column( "Pred Formula neg FzR0min" ) << get formula;

a = Char( Name Expr( f ));

t = Concat(t, a);

Save Text File( "myformula.txt", t );

t = "";

f = Column( "Pred Formula neg MxBmin" ) << get formula;

a = Char( Name Expr( f ));

t = Concat(t, a);

t = concat(t, "\!N");

t = concat(t, "\!N");

f = Column( "Pred Formula MxBmin" ) << get formula;

a = Char( Name Expr( f ));

t = Concat(t, a);

t = concat(t, "\!N");

t = concat(t, "\!N");

f = Column( "Pred Formula MxBmax" ) << get formula;

a = Char( Name Expr( f ));

t = Concat(t, a);

t = concat(t, "\!N");

t = concat(t, "\!N");

f = Column( "Pred Formula MrB" ) << get formula;

a = Char( Name Expr( f ));

t = Concat(t, a);

t = concat(t, "\!N");

t = concat(t, "\!N");

f = Column( "Pred Formula neg FzR0min" ) << get formula;

a = Char( Name Expr( f ));

t = Concat(t, a);

Save Text File( "myformula.txt", t );