cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
schou1994
Level II

How to input multiple inputs to multiple models?

Hi all,

 

Imagine I have 15 independent sets of data pairs (0,b1) to (10,z1), (0,b2) to (10,z2)......all the way to (0,b15) to (10,z15). Imagine that for each pair, the first data point is at 0 hours, the second is at 10 hours.

 

Then, I have another 15 independent sets of data that have different values, but the same concept as above. Let us assume the first 15 set is "before" and the second 15 set is "after".

 

1) For "before", I want get 15 line of best fit between the two points of each of my 15 sets. I want to be able to input 4 hours and have the line of best fit model spit out the predicted response. So end result should be 15 outputs at 4 hours. I know how to output a predicted model column for ONE model, but i don't know about MANY models at once?

 

2) Then, I want to make 15 line of best fits for each of the "after". Finally, I want to put each of the 15 outputs from step 1) into each output from my line models from 2), and get 255 different inputs (hours) result...I should get 15 x 15 = 255 predicted hours.

 

Is this possible with JMP?

 

 

2 REPLIES 2
Georg
Level VII

Re: How to input multiple inputs to multiple models?

Yes, I think it is. Or what more answer did you expect by this question?

 

In JMP you can realize almost everything by scripting.

And interactively you can e.g. using the by role for fitting different models on different sets.

 

But to get the help you want, I think you need to be more specific and give us an example of your datastructure, how it looks like.

Perhaps the enclosed script helps you to do the first step, fitting the model for several datasets in a table.

Than of course you can drag out the model,

and deploy it to other data ...

 

 

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

dt << Bivariate(
	SendToByGroup( {:sex == "F"} ),
	Y( :weight ),
	X( :height ),
	Fit Line( {Line Color( {33, 116, 145} )} ),
	By( :sex ),
	SendToByGroup(
		{:sex == "F"},
		SendToReport(
			Dispatch(
				{"Bivariate Fit of weight By height sex=F"},
				"Linear Fit",
				OutlineBox,
				{Close( 1 )}
			)
		)
	),
	SendToByGroup(
		{:sex == "M"},
		SendToReport(
			Dispatch(
				{"Bivariate Fit of weight By height sex=M"},
				"Linear Fit",
				OutlineBox,
				{Close( 1 )}
			)
		)
			
	)
);
Georg
ih
Super User (Alumni) ih
Super User (Alumni)

Re: How to input multiple inputs to multiple models?

I agree with @Georg that you are going to need a scripting solution.  You could write or save a script to perform the function you mentioned for a single variable, and then introduce loops to perform that same script for every other variable.  The scripting guide will be a great resource to help you get started.

 

 

indvars = {:x1, :x2, :x3};
depvars = {:y1, :y2, :y3};
for( i = 1, i <= n items( indvars ), i++,
	for( d = 1, d <= n items( depvars ), d++,
		fm = Fit Model(
			//the script to fit your model goes here
		);
		fm << Save Prediction Formula; // this would depend which platform you use
		fm << close Window;
	)
);