Input entire column of Unknowns for Inverse PredictionHello,
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-curve/
Thanks!
Meghan
Re: Input entire column of Unknowns for Inverse PredictionJust wanted to reiterate how awesome this script is. As a new JMP user, I really appriciate your effort.
Re: Input entire column of Unknowns for Inverse PredictionThis 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.)Re: Input entire column of Unknowns for Inverse PredictionThis 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.
Re: Input entire column of Unknowns for Inverse PredictionHi 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
Re: Input entire column of Unknowns for Inverse PredictionI 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?