- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
How to export parameters calculated by nonlinear modeling
Alright JMP mavens, you just helped me for the first time earlier today hopefully you have it in you again .
So, because of the help I received earlier, I have been able to use JMP to estimate two parameters for over 1400 different experiments. This data has been exported from a database, so each experiment has a unique ID. Now, it would be a real pain to have to manually enter both of these parameters for each of the experiments back into the database. So, is there an easy way I can generate a table that has the experiment ID, the b0, and the b1 for each experiment from the nonlinear modeling window?
Thanks in advance!
--Surface Thought
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to export parameters calculated by nonlinear modeling
Not sure how you can be sure that 1400 nonlinear regressions all converged, but assuming you are, the following table and script should point you in the right direction. The formula in the :Formula column is b0 + b1*x where the parameters b0 and b1 are 1 and 2 respectively.
Script:
nlin = Nonlinear(
Y( :y ),
X( :Formula ),
Unthreaded( 1 ),
Newton,
Finish,
By( :ID )
);
rnlin1 = Report( nlin[1] );
parms = rnlin1["Nonlinear Fit ID=1"]["Solution"][Table Box( 2 )]
<< make combined data table;
parms << Transpose(
columns( :Estimate ),
By( :ID ),
Label( :Parameter ),
Output Table( "Parameters by ID" )
);
/*
parms << Split(
Split By( :Parameter ),
Split( :Estimate, :ApproxStdErr ),
Group( :ID )
)
*/
Demo Data Table:
ID x y Formula
1 1 14.007192425 3
1 2 17.212873694 5
1 3 19.206116204 7
1 4 22.698900479 9
1 5 26.547313123 11
1 6 27.964537384 13
1 7 32.187880488 15
1 8 34.471305291 17
1 9 37.982516136 19
1 10 39.725363966 21
2 1 18.727600524 3
2 2 20.500227504 5
2 3 18.715068521 7
2 4 22.667963466 9
2 5 25.505984818 11
2 6 25.947839552 13
2 7 27.933068812 15
2 8 31.390339224 17
2 9 32.390010591 19
2 10 34.514002505 21
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to export parameters calculated by nonlinear modeling
Not sure how you can be sure that 1400 nonlinear regressions all converged, but assuming you are, the following table and script should point you in the right direction. The formula in the :Formula column is b0 + b1*x where the parameters b0 and b1 are 1 and 2 respectively.
Script:
nlin = Nonlinear(
Y( :y ),
X( :Formula ),
Unthreaded( 1 ),
Newton,
Finish,
By( :ID )
);
rnlin1 = Report( nlin[1] );
parms = rnlin1["Nonlinear Fit ID=1"]["Solution"][Table Box( 2 )]
<< make combined data table;
parms << Transpose(
columns( :Estimate ),
By( :ID ),
Label( :Parameter ),
Output Table( "Parameters by ID" )
);
/*
parms << Split(
Split By( :Parameter ),
Split( :Estimate, :ApproxStdErr ),
Group( :ID )
)
*/
Demo Data Table:
ID x y Formula
1 1 14.007192425 3
1 2 17.212873694 5
1 3 19.206116204 7
1 4 22.698900479 9
1 5 26.547313123 11
1 6 27.964537384 13
1 7 32.187880488 15
1 8 34.471305291 17
1 9 37.982516136 19
1 10 39.725363966 21
2 1 18.727600524 3
2 2 20.500227504 5
2 3 18.715068521 7
2 4 22.667963466 9
2 5 25.505984818 11
2 6 25.947839552 13
2 7 27.933068812 15
2 8 31.390339224 17
2 9 32.390010591 19
2 10 34.514002505 21
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to export parameters calculated by nonlinear modeling
Wow! This is really good work and exactly what I needed thank you! However, as for the caveat that you raised about being sure that all of the regressions converge, I am actually quite sure that not all of them converge. I had assumed (and you know what they say about making assumptions) that if it didn't converge it would just display a NA or something equivalent, which would be fine for my purposes. However it appears that it just displays the parameters that it had at the end of the last iteration. Is there any way to tell it to exclude a value if it does not converge, or enter a value of NA?
Thank you so much!
Edit: Also, this is (probably obviously) my first time trying to do scripting in JMP ( I only have a bit of experience playing around with VB in Excel and Access). Where is the proper resource where I can look up these commands used in the script? For instance, I would just like to look up the nlin command to see what the "Unthreaded" and the "Newton" argument were.
Edit: Alright after working with the outputed data for a while it became clear that the experiments for which model could not converge we simply not copied over on the output table. So this actually does exactly what I need it to. Thanks!
--
SurfaceThought