Share your ideas for the JMP Scripting Unsession at Discovery Summit by September 17th. We hope to see you there!
Choose Language Hide Translation Bar
Highlighted
Level I

## Input entire column of Unknowns for Inverse Prediction

Hello,

I have a 100 Unknowns to calculate from a linear fit. I followed the instructions for "Inverse Prediction" shown here:

https://www.jmp.com/support/help/14/inverse-prediction-2.shtml#149268

That worked fine, but using this method, I can only (manually) input 8 Unknowns at a time. Is there another way to do this (like there is in Prism)? Or is there a script that can do it? Prism method: https://www.graphpad.com/support/faq/prism-3-calculating-unknown-concentrations-using-a-standard-cur...

Thanks!

Meghan

5 REPLIES 5
Highlighted
Staff

## Re: Input entire column of Unknowns for Inverse Prediction

I think that a script would provide the best solution. Are the standards and unknowns in the same data table or separate data tables? Better still, can you provide an example of a typical data set with both the standards and unknowns?

Learn it once, use it forever!
Highlighted
Level I

## Re: Input entire column of Unknowns for Inverse Prediction

Hi Mark,

I've attached some sample data to this note--standard and unknowns are in the same data table.

In this example, I have a standard curve with two points 10 and 150 in duplicate. I want to interpolate the Unknowns [here gDNA pg/uL] which I've left blank.

Meghan

Highlighted
Staff

## Re: Input entire column of Unknowns for Inverse Prediction

This script will perform the inverse prediction for each chip ID separately.

``````Names Default to Here( 1 );

dt = Current Data Table();

Column( 2 ) << Data Type( "Numeric" ) << Modeling Type( "Continuous" );
Column( 3 ) << Data Type( "Numeric" ) << Modeling Type( "Continuous" );

dt << New Column( "Lower 95%", "Numeric", "Continuous" )
<< New Column( "Upper 95%", "Numeric", "Continuous" );

Summarize( chip = By( :Chip ID ) );

n groups = N Items( chip );

For( c = 1, c <= n groups, c++,
data = dt << Get Rows Where( :Chip ID == chip[c] );
dt << Select Where( :Chip ID != chip[c] ) << Exclude;
fls = dt << Fit Model(
Y( :Median Electrode ),
Effects( :Name( "gDNA pg/uL" ) ),
Personality( "Standard Least Squares" ),
Emphasis( "Minimal Report" ),
Run
);
unknown = :Median Electrode[data[3]::data[N Row(data)-2]];
Eval(
Substitute(
Expr(
fls << Inverse Prediction(
Term Value( Name( "gDNA pg/uL" )(.) ),
Response( rrr )
)
),
Expr( rrr ),
unknown
)
);
inv pred report = Report( fls )["Inverse Prediction"];
inv pred = inv pred report[NumberColBox(2)] << Get As Matrix;
lower = inv pred report[NumberColBox(3)] << Get As Matrix;
upper = inv pred report[NumberColBox(4)] << Get As Matrix;
fls << Close Window;
For( i = 1, i < N Row( data ) - 3, i++,
Column( 2 )[data[i+2]] = inv pred[i];
Column( 4 )[data[i+2]] = lower[i];
Column( 5 )[data[i+2]] = upper[i];
);
dt << Exclude << Clear Select;
);``````

Note: it will fail unless you remove the empty rows at the end. One of the standards is missing the value 10 for the known concentration.

Learn it once, use it forever!
Highlighted
Level I

## Re: Input entire column of Unknowns for Inverse Prediction

This works and is a great start for our application! Thank you so much!! Next we need to figure out how to do the inverse prediction not by Chip, but by all the standard curve values across the Chips. (We have just started learning JMP.)
Highlighted
Level I

## Re: Input entire column of Unknowns for Inverse Prediction

Just wanted to reiterate how awesome this script is. As a new JMP user, I really appriciate your effort.

Article Labels

There are no labels assigned to this post.