We’re asking you to select a content label when starting a new topic in the Discussions area. Read more to find out why.
Choose Language Hide Translation Bar
Highlighted
jb99
Level II

Automate nonlinear analysis across groups specified by "By" variable

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
Highlighted
txnelson
Super User

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

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

View solution in original post

4 REPLIES 4
Highlighted
txnelson
Super User

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

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
jb99
Level II

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

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?

Highlighted
txnelson
Super User

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

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

View solution in original post

Highlighted
ian_jmp
Staff

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

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));