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
- :
- How to store script in data table using JSL?

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

Apr 12, 2010 12:52 PM
(1136 views)

I posted this to the 'JMP-L@WUBIOS.WUSTL.EDU' list and someone suggested I try posting my question here:

I’ve written a script that makes a new data table based on an open report. I want to store the script that made the report in the new data table but haven’t been able to figure out how to do it.

What I’ve tried is:

cvdt = New Table( "cv table" );

FLS = fit least squares[1];

fitscript=FLS< cvdt< cvdt<

I’ve also tried setting the table property directly using:

cvdt<

What I end up with if I view the script stored in the data table is:

Name Expr( fitscript )

But what I want is something like this:

Fit Model(

Y( :Response ),

Effects( :X 1, :X 2, :X 3, :X 4 ),

Personality( Standard Least Squares ),

Emphasis( Effect Leverage ),

Run Model(

:Response << {Analysis of Variance( 0 ), Lack of Fit( 0 ),

Show Prediction Expression( 1 ),

Plot Actual by Predicted( 0 ), Plot Regression( 0 ),

Plot Residual by Predicted( 0 ), Plot Effect Leverage( 0 )}

)

)

So, how do I get the script contained within “fitscript” to show up in the data table property? I’ve tried lots of different combinations of nested expr() char() eval() and name expr() and must confess that I don’t understand how these things work. I have previously successfully stored a formula in a column by using nameexpr() but that doesn’t seem to be working when I try to store it in the data table property.

Note: I don't necessarily need the script to be executable, if I could store it as a string that would be acceptable--I mostly want to document what model was used to generate the new data table.

Thanks in advance for your help.

-Craig

I’ve written a script that makes a new data table based on an open report. I want to store the script that made the report in the new data table but haven’t been able to figure out how to do it.

What I’ve tried is:

cvdt = New Table( "cv table" );

FLS = fit least squares[1];

fitscript=FLS<

I’ve also tried setting the table property directly using:

cvdt<

What I end up with if I view the script stored in the data table is:

Name Expr( fitscript )

But what I want is something like this:

Fit Model(

Y( :Response ),

Effects( :X 1, :X 2, :X 3, :X 4 ),

Personality( Standard Least Squares ),

Emphasis( Effect Leverage ),

Run Model(

:Response << {Analysis of Variance( 0 ), Lack of Fit( 0 ),

Show Prediction Expression( 1 ),

Plot Actual by Predicted( 0 ), Plot Regression( 0 ),

Plot Residual by Predicted( 0 ), Plot Effect Leverage( 0 )}

)

)

So, how do I get the script contained within “fitscript” to show up in the data table property? I’ve tried lots of different combinations of nested expr() char() eval() and name expr() and must confess that I don’t understand how these things work. I have previously successfully stored a formula in a column by using nameexpr() but that doesn’t seem to be working when I try to store it in the data table property.

Note: I don't necessarily need the script to be executable, if I could store it as a string that would be acceptable--I mostly want to document what model was used to generate the new data table.

Thanks in advance for your help.

-Craig

2 REPLIES

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

You are close.

Here is one example.

Here is one example.

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

I got the answer to this question from the jmp list on lists.biostat.wustl.edu :

Mark Bailey wrote:

> The New Property() message takes two arguments that must be a

> character string for the property name and an expression for the

> value. The second argument is used as a literal value, so you cannot

> use any variable or function of a variable to supply the second

> argument. Instead, use

> substitution:

>

> Eval(

> Substitute(

> Expr(

> cvdt << New Property( "CV Model",

> sss

> )

> ),

> Expr( sss ),

> Name Expr( fitscript )

> )

> );

>

> Hope that this explanation helps.

>

> Mark

>

This worked as desired.

Mark Bailey wrote:

> The New Property() message takes two arguments that must be a

> character string for the property name and an expression for the

> value. The second argument is used as a literal value, so you cannot

> use any variable or function of a variable to supply the second

> argument. Instead, use

> substitution:

>

> Eval(

> Substitute(

> Expr(

> cvdt << New Property( "CV Model",

> sss

> )

> ),

> Expr( sss ),

> Name Expr( fitscript )

> )

> );

>

> Hope that this explanation helps.

>

> Mark

>

This worked as desired.