topic Re: JMP Script for inverse prediction in Discussions
https://community.jmp.com/t5/Discussions/JMP-Script-for-inverse-prediction/m-p/49124#M27916
<P>Hello again, </P><P> </P><P>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.</P><P> </P><P>Regards</P><P>Rob</P><P> </P>Tue, 02 Jan 2018 08:31:47 GMTRobertasm2018-01-02T08:31:47ZJMP Script for inverse prediction
https://community.jmp.com/t5/Discussions/JMP-Script-for-inverse-prediction/m-p/49097#M27898
<P>Hello everyone,</P><P> </P><P>I want to automate my data analysis, therefore I wanted to write myself a script to make things easier.</P><P> </P><P>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)</P><P> </P><P>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) </P><P> </P><P>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.</P><P> </P><P>Thank you in advance !</P><P>Robert</P><P> </P><P> </P><P> </P><P> </P><P> </P>Fri, 29 Dec 2017 10:12:56 GMThttps://community.jmp.com/t5/Discussions/JMP-Script-for-inverse-prediction/m-p/49097#M27898Robertasm2017-12-29T10:12:56ZRe: JMP Script for inverse prediction
https://community.jmp.com/t5/Discussions/JMP-Script-for-inverse-prediction/m-p/49098#M27899
<P>What is the question you are asking?</P>
<P>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?</P>
<P> </P>
<P>I am not sure what you are asking.</P>Fri, 29 Dec 2017 12:53:32 GMThttps://community.jmp.com/t5/Discussions/JMP-Script-for-inverse-prediction/m-p/49098#M27899txnelson2017-12-29T12:53:32ZRe: JMP Script for inverse prediction
https://community.jmp.com/t5/Discussions/JMP-Script-for-inverse-prediction/m-p/49099#M27900
<P>Sorry for that !</P><P> </P><P>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)</P>Fri, 29 Dec 2017 12:58:53 GMThttps://community.jmp.com/t5/Discussions/JMP-Script-for-inverse-prediction/m-p/49099#M27900Robertasm2017-12-29T12:58:53ZRe: JMP Script for inverse prediction
https://community.jmp.com/t5/Discussions/JMP-Script-for-inverse-prediction/m-p/49100#M27901
<P>The Scripting Index for "Save Inverse Prediction Formula" specifies the following structure to produce the new column</P>
<PRE><CODE class=" language-jsl">fc=dt<<Fit Curve(Y( :average), X( :Log conc));
fc << Fit Logistic 4P(Save inverse prediction Formula);</CODE></PRE>
<P> </P>Fri, 29 Dec 2017 13:06:56 GMThttps://community.jmp.com/t5/Discussions/JMP-Script-for-inverse-prediction/m-p/49100#M27901txnelson2017-12-29T13:06:56ZRe: JMP Script for inverse prediction
https://community.jmp.com/t5/Discussions/JMP-Script-for-inverse-prediction/m-p/49124#M27916
<P>Hello again, </P><P> </P><P>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.</P><P> </P><P>Regards</P><P>Rob</P><P> </P>Tue, 02 Jan 2018 08:31:47 GMThttps://community.jmp.com/t5/Discussions/JMP-Script-for-inverse-prediction/m-p/49124#M27916Robertasm2018-01-02T08:31:47ZRe: JMP Script for inverse prediction
https://community.jmp.com/t5/Discussions/JMP-Script-for-inverse-prediction/m-p/49134#M27926
<P>I would change the methodology you are using to create the new columns to using the function</P>
<P> Clone Formula Column()</P>
<P>Definition and an example(I copied it into this response) is available in the Scripting Index</P>
<P> Help==>Scripting Index==>Data Table Cols==>Clone Formula Column</P>
<PRE><CODE class=" language-jsl">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 )
);</CODE></PRE>Tue, 02 Jan 2018 14:37:41 GMThttps://community.jmp.com/t5/Discussions/JMP-Script-for-inverse-prediction/m-p/49134#M27926txnelson2018-01-02T14:37:41ZRe: JMP Script for inverse prediction
https://community.jmp.com/t5/Discussions/JMP-Script-for-inverse-prediction/m-p/49301#M28026
<P>Also, could someone help me with the script for the mean formula.</P><P> </P><P>I can't get it to work for me.</P><P> </P><P>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... </P>Fri, 05 Jan 2018 13:54:14 GMThttps://community.jmp.com/t5/Discussions/JMP-Script-for-inverse-prediction/m-p/49301#M28026Robertasm2018-01-05T13:54:14ZRe: JMP Script for inverse prediction
https://community.jmp.com/t5/Discussions/JMP-Script-for-inverse-prediction/m-p/49308#M28027
<P>I am not exactly sure of what you are asking for. There are 2 guesses as to what you are looking for;</P>
<P>1. You want the mean of 3 columns separately for each row.</P>
<PRE><CODE class=" language-jsl">TheMean = Mean( :A, :B, :C)</CODE></PRE>
<P>2. You want to find the average of all of the data for 3 columns:</P>
<PRE><CODE class=" language-jsl">TheMean = ( Col Sum( :A ) + Col Sum( :B ) + Col Sum( :C ) ) /
( Col Number( :A ) + Col Number( :B ) + Col Number( :C ) );</CODE></PRE>
<P>The above piece of code could be shortened to</P>
<PRE><CODE class=" language-jsl">TheMean = Mean( Col Mean( :A ), Col Mean( :B ), Col Mean( :C ) );</CODE></PRE>
<P>if the number of data points are equal in each of the columns</P>Fri, 05 Jan 2018 15:19:51 GMThttps://community.jmp.com/t5/Discussions/JMP-Script-for-inverse-prediction/m-p/49308#M28027txnelson2018-01-05T15:19:51ZRe: JMP Script for inverse prediction
https://community.jmp.com/t5/Discussions/JMP-Script-for-inverse-prediction/m-p/49362#M28067
<P>I have managed to correct my script and it does produce me the last "hcp" column results according to inverse prediction.</P><P> </P><P>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 ? </P><P> </P><P>i.e.</P><P> </P><P>Script line 11:</P><P> </P><P> fc=dt<<Fit Curve(Y( :average), X( :Log conc), Fit Logistic 4P);</P><P> </P><P>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.</P><P> </P><P>Thanks</P><P> </P><P> </P><P> </P><P> </P><P> </P><P> </P>Mon, 08 Jan 2018 12:01:07 GMThttps://community.jmp.com/t5/Discussions/JMP-Script-for-inverse-prediction/m-p/49362#M28067Robertasm2018-01-08T12:01:07ZRe: JMP Script for inverse prediction
https://community.jmp.com/t5/Discussions/JMP-Script-for-inverse-prediction/m-p/49366#M28070
<P>What error message is in the log?</P>
<P>Have you just tried changing line 7 to see if what you are thinking might fix the problem does fix the problem?</P>
<P> </P>Mon, 08 Jan 2018 13:43:08 GMThttps://community.jmp.com/t5/Discussions/JMP-Script-for-inverse-prediction/m-p/49366#M28070txnelson2018-01-08T13:43:08ZRe: JMP Script for inverse prediction
https://community.jmp.com/t5/Discussions/JMP-Script-for-inverse-prediction/m-p/49427#M28108
<P>It says name unresolved..</P>Tue, 09 Jan 2018 13:48:22 GMThttps://community.jmp.com/t5/Discussions/JMP-Script-for-inverse-prediction/m-p/49427#M28108Robertasm2018-01-09T13:48:22ZRe: JMP Script for inverse prediction
https://community.jmp.com/t5/Discussions/JMP-Script-for-inverse-prediction/m-p/49429#M28109
<P>What the error message is saying, is that the name "Standard Average" or whatever name you used does not exist. So apparently, there is not a column in your data table named "Standard Average". In looking at your script, the column named "Average" is created on line 7 and then it is referenced when running the "Fit Curve" platform on line 11. So if the sole issue is that you want to call the column "Standard Average" rather than "Average", then you have to change the name of the column when it is created in the "New Column" message, so that you can reference the column with its different name in the "Fit Curve" platform..</P>Tue, 09 Jan 2018 14:16:17 GMThttps://community.jmp.com/t5/Discussions/JMP-Script-for-inverse-prediction/m-p/49429#M28109txnelson2018-01-09T14:16:17Z