## Re: Automate nonlinear analysis across groups specified by "By" variable

New Contributor

Joined:

Jul 15, 2017

I am performing a nonlinear anlysis (Specialized modeling, nonlinear) on a large plant growth dataset made up of hundreds of types of plant. In the nonlinear platform, the Y is plant size, the X is time, and I want to do this analysis "By" plant type.  This leads to hundreds of "fit curve" boxes in which I would have to specify further anlalyses. Instead, I would like to automate this process, by fitting the peak model "fit gaussian peak" in every case. I would then create a combined table with all of the (hundreds) of estimated parameter values.

Can anyone please advise on whether I can automate this process to run hundreds of "fit gaussian peak" models at the same time?

1 ACCEPTED SOLUTION

Accepted Solutions

Super User

Joined:

Jun 22, 2012

Solution

Here is the same example, but with a "By" clause.  All of this is available in the Scripting Index.

Help==>Scripting Index==>Fit Curve

The Scripting Index and the Scripting Guide are the definitive publications that contain the definative information on JSL.

``````Fit Curve( Y( :height ), X( :weight ),
Fit Gaussian Peak,
by(:sex)
);``````
Jim
4 REPLIES

Super User

Joined:

Jun 22, 2012

You need to run your analysis interactively and then save the script, and you will get the code to Fit Gaussian Peak

``Fit Curve( Y( :height ), X( :weight ), Fit Gaussian Peak );``
Jim

New Contributor

Joined:

Jul 15, 2017

Thanks, but how would I do the analysis By "Plant type", so that the gaussian fit is done separately for the hundreds of plant types?

Super User

Joined:

Jun 22, 2012

Solution

Here is the same example, but with a "By" clause.  All of this is available in the Scripting Index.

Help==>Scripting Index==>Fit Curve

The Scripting Index and the Scripting Guide are the definitive publications that contain the definative information on JSL.

``````Fit Curve( Y( :height ), X( :weight ),
Fit Gaussian Peak,
by(:sex)
);``````
Jim
Highlighted

Staff

Joined:

Jun 23, 2011

And (building on Jim's example) you can get the parameter estimates into a table like this:

``````NamesDefaultToHere(1);

dt = Open("\$SAMPLE_DATA/Big Class.jmp");
fc = dt << Fit Curve( Y( :height ), X( :weight ),  Fit Gaussian Peak, by(:sex));
// Get all the parameter estimates into a single table
firstRep = Report(fc[1]);
dt2 = firstRep[TableBox(3)] << makeCombinedDataTable;
dt2 << setName("Parameter Estimates from "||(dt << getName));``````