Choose Language Hide Translation Bar
Highlighted
CT_MG
Level II

How to Develop ADD-IN with Existing Analyze Function ???

How can I import an existing JMP module (ex. Fit model - Model specification) into my JSL?

I want to develop an ADD-IN with existing analyze function (ex. Distribution, Fit model, ...)

 

 

More specifically, I try to develop an ADD-IN with the following procedure:

 

1. Develop an ADD-IN using the Fit model - Model Specification module.

 

[Select Columns, Pick Role Variables] + [Choose Fit Stepwise for the Personality] → [Run Model] → [Report Appear]

 

2. Using the values from several tables which appear in the report such as Lack of Fit, Summary of Fit, 
attach a new table which is generated by JSL to the report automatically. 

 

 

 

I have continued to use JSL, but have never used ADD-IN...

I really appreciate it if you help me.

 

Thanks.

MGO
5 REPLIES 5
Highlighted
Byron_JMP
Staff

Re: How to Develop ADD-IN with Existing Analyze Function ???

For the second half of your question. This is an example, something I was just working on.

I subsittued in a data set from the sample library, so the analysis might not make sense, it just an example for the script.

 


//dt=pick file();
//dt=current data table();
Open("$SAMPLE_DATA/Quality Control/Diameter.jmp")

fm=expr(dt<<Fit Model(
	Y( Log( :DIAMETER ) ),
	Effects( :DAY[:OPERATOR] & Random, :OPERATOR, :MACHINE & Random ),
	NoBounds( 0 ),
	Personality( "Standard Least Squares" ),
	Method( "REML" ),
	Emphasis( "Minimal Report" ),
	RUN()
));

obj=fm;  //run the expression
objr=obj<<report; //turn the output into a report that can be reference

obj << Conditional Residuals;
objr<<append(dt<<Distribution(
	Continuous Distribution(
		Column( :Name( "Cond Residual Log(DIAMETER)" ) ),
		Horizontal Layout( 1 ),
		Vertical( 0 ),
		Fit Distribution(
			Normal(
				Diagnostic Plot( Median Reference Line( 0 ) ),
				Goodness of Fit( 1 )
			)
		)
	)
));
JMP Systems Engineer, Pharm and BioPharm Sciences
Highlighted
CT_MG
Level II

Re: How to Develop ADD-IN with Existing Analyze Function ???

I appreciate your kindness. Byron !!

 

Can I create Script(JSL) or ADD-IN that reflects everything you tell me to every each Response?

Let's say that there are five Diameters in the sample data table, Diameter1 to Diameter5.
Dia.PNG

Can I automatically attach each Distribution results to the Fit model results for those 5 responses??

(In my case, I analyze a bunch of responses so that it's a bit burden to apply COPY/PASTE your JSL for all responses ....!

 

How can I create a new ADD-IN and output the combined report automatically instead of editing with COPY/PASTE?

Do I have to open the Fit model script and attach the Distribution scrip using “append” whenever I analyze every single response?

 

Thank you again for your kind answer :)  

 

 

 

MGO
Highlighted
txnelson
Super User

Re: How to Develop ADD-IN with Existing Analyze Function ???

@Byron_JMP provided a nice example of taking a result from one Platform (Fit Model) and using it in a second Platform (Distribution) to produce the desired results.  The expectation, is that using normal programming methodologies, that you can expand on the example and turn it into the end product you need.  

My reading of your response to his example, is that you are not at an experience level with programming and more specifically with JMP Scripting Language (JSL) programming where you can take his example and expand upon it.

Your question:

Can I create Script(JSL) or ADD-IN that reflects everything you tell me to every each Response?

Let's say that there are five Diameters in the sample data table, Diameter1 to Diameter5. 

Is answered, Yes.  By looping across all columns, you can easily generate the output for multiple Diameters.

Your question:

Can I automatically attach each Distribution results to the Fit model results for those 5 responses??

(In my case, I analyze a bunch of responses so that it's a bit burden to apply COPY/PASTE your JSL for all responses ....!

Is answered, Yes.  JSL functions will allow you to build your final desired output report from whatever components from the different Platforms that you desire.

Your last question:

How can I create a new ADD-IN and output the combined report automatically instead of editing with COPY/PASTE?

Do I have to open the Fit model script and attach the Distribution scrip using “append” whenever I analyze every single response?

This answer is really to state, that you can do all of this in JSL, and the actual code for it will require more specific information on the precise output needs that you have.

 

But what I really think you need is that you need to spend the majority of your time learning more about JSL.  There is a great reference document, the Scripting Guide, that is available under the JMP Help pull down menu.

     Help==>Books==>Scripting Guide

I strongly suggest that you take your ideas of what you need, and then spend the time reading the Scripting Guide.  While you go through the guide, you will pick up on the functions and methodologies that you can pick and choose, to build the end product you desire.

 

Then as you build your JSL code, and run across issues etc. you can come to the Discussion Community with more specific questions and problems that the members will gladly help you with.

 

Jim
Highlighted
CT_MG
Level II

Re: How to Develop ADD-IN with Existing Analyze Function ???

Dear txnelson,

 

Thank you so much for answering!

 

I am studying JSL eagerly, referring to the "Scripting Guide" that you mentioned.

 

With reference to the Scripting Guide, I have already implemented the first answer using JSL as shown below.
(txnelson : "By looping across all columns, you can easily generate the output for multiple Diameters")

================================Example Code===================================

F0 = Fit Group (
  F1 = Fit Model (
    Y (: Diameter1),
    ...
    ),
    ...
  F5 = Fit Model (
  Y (: Diameter5),
  ...
  )
);

N_Response = 5;

 

for (i = 1, i <= N_Response, i ++,
Eval (Parse (Eval Insert ("\ [... MY CODE ...] \"))); / * MY CODE can be any script like Distribution!
);

===================================================================

But here is the problem.
When writing code like the above, I should define some variables such as F0, F1,...and F5 in JSL before Looping.
I want to implement an ADD-IN that automatically applies MY CODE to each response selected in the Fit model-Model Specification module (responses used for the analysis).

 

I will continue to study JSL step by step through the “Scripting Guide”!

but it seems that it is another problem to make ADD-IN using MY CODE.

 

Is there a great reference document that has been optimized for studying ADD-IN???

If there is, please let me know :)

 

I would appreciate it if you could reply my question!

MGO
Highlighted
txnelson
Super User

Re: How to Develop ADD-IN with Existing Analyze Function ???

I don't think you should be worrying about Add-In specifications right now.  If you build your JSL, you can turn it into an Add-In with a couple of easy steps.

Below is a simple piece of JSL that generates different output across the columns found in a data table.  It should give you an example of one way to structure your code.

Names Default To Here( 1 );

dt = Open( "$SAMPLE_DATA/big class.jmp" );

dist = Function( {x},
	{default local},
	Distribution( Continuous Distribution( Column( Column( x ) ) ) )
);

one = Function( {x, y},
	{default local},
	Oneway( Y( Column( y ) ), X( Column( x ) ) );
	pp = Partition( Y( Column( y ) ), X( Column( x ) ), Informative Missing( 1 ) );
	pp << splitbest( 2 );
);

// Get the continuous column in the data table
colList = dt << get column names( continuous, string );

// Loop across columns and generate the output
For( i = 1, i <= N Items( colList ), i++,
	dist( colList[i] );
	one( colList[i], "Age" );
);

But there are many, many variations on this, depending on where you need to end up.

Jim
Article Labels

    There are no labels assigned to this post.