Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

- JMP User Community
- :
- Discussions
- :
- Re: JMP Script for inverse prediction

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

JMP Script for inverse prediction

Dec 29, 2017 2:12 AM
(3976 views)

Hello everyone,

I want to automate my data analysis, therefore I wanted to write myself a script to make things easier.

Basically, I want to take my standards to generate a standard curve using 4P fit. (Columns 1, 2, 3 are triplicates of those standards, so I want to have an average value)

Afterwards, I want to use the inverse prediction formula that has been generated by the 4P fit and apply it to the remaining samples (Columns 4 to 12, they are also in triplicates. e.i. columns 4, 5, 6 take average and apply inverse prediction)

Reason why I stack all my data is that it makes a lot easier to take all this data and put it in the official report.

Thank you in advance !

Robert

11 REPLIES 11

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: JMP Script for inverse prediction

What is the question you are asking?

I understand what you want to do, and I see the script. Doesn't the script work? Do you want to set the script up to be automated by running the JMP Scheduler?

I am not sure what you are asking.

Jim

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: JMP Script for inverse prediction

Sorry for that !

So my problem is that my script does not work fully. For some reason it does not give me the inverse prediction in the hcp column (when I check the formula in the hcp column it is emty for some reason)

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: JMP Script for inverse prediction

The Scripting Index for "Save Inverse Prediction Formula" specifies the following structure to produce the new column

```
fc=dt<<Fit Curve(Y( :average), X( :Log conc));
fc << Fit Logistic 4P(Save inverse prediction Formula);
```

Jim

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: JMP Script for inverse prediction

Hello again,

So I did correct this mistake, but it still doesn't generate me the last column with inverse predicted values for my other samples... So I suppose that there is a mistake or I am missing a line with the part where I want to get the inverse prediction formula and set it for hcp column.

Regards

Rob

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: JMP Script for inverse prediction

I would change the methodology you are using to create the new columns to using the function

Clone Formula Column()

Definition and an example(I copied it into this response) is available in the Scripting Index

Help==>Scripting Index==>Data Table Cols==>Clone Formula Column

```
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Blood Pressure.jmp" );
dt << New Column( "Day 1",
Formula( (:BP 8M + :BP 12M + :BP 6M) / 3 )
);
list1 = {:BP 8W, :BP 8F};
list2 = {:BP 12W, :BP 12F};
list3 = {:BP 6W, :BP 6F};
dt <<
Clone Formula Column(
"Day 1",
2,
Substitute Column Reference( :BP 8M, list1 ),
Substitute Column Reference( :BP 12M, list2 ),
Substitute Column Reference( :BP 6M, list3 )
);
```

Jim

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: JMP Script for inverse prediction

Also, could someone help me with the script for the mean formula.

I can't get it to work for me.

What I want to do is to take 3 columns and get an average of 3 columns across all rows. JMP script guide doesn't provide the script for it...

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: JMP Script for inverse prediction

I am not exactly sure of what you are asking for. There are 2 guesses as to what you are looking for;

1. You want the mean of 3 columns separately for each row.

`TheMean = Mean( :A, :B, :C)`

2. You want to find the average of all of the data for 3 columns:

```
TheMean = ( Col Sum( :A ) + Col Sum( :B ) + Col Sum( :C ) ) /
( Col Number( :A ) + Col Number( :B ) + Col Number( :C ) );
```

The above piece of code could be shortened to

`TheMean = Mean( Col Mean( :A ), Col Mean( :B ), Col Mean( :C ) );`

if the number of data points are equal in each of the columns

Jim

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: JMP Script for inverse prediction

I have managed to correct my script and it does produce me the last "hcp" column results according to inverse prediction.

The next question I have is why when I change my column names, hcp column no longer produces inverse prediction for me, is there a mistake in my script ?

i.e.

Script line 11:

fc=dt<<Fit Curve(Y( :average), X( :Log conc), Fit Logistic 4P);

If I change the name of my my column from "average" to lets say Standard Average, I no longer get my predictions in the hcp column. I do change my column name in the line 7 as well to Standard Average before running the script.

Thanks

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Email to a Friend
- Report Inappropriate Content

Re: JMP Script for inverse prediction

What error message is in the log?

Have you just tried changing line 7 to see if what you are thinking might fix the problem does fix the problem?

Jim

Article Labels

There are no labels assigned to this post.