New to JMP and trying to generate a table that will report specific values from a larger data tableI have a table with three key columns: "Well Position", "Temperature", and "Derivative". Well Position is nominal (A1, A2, B1, B2, etc.), while the other two are continuous. I'm trying to create a new table that will report the temperature at which the derivative is a minimum for each well positon. So far, I've been able to use the tabulate function to generate a table that reports the minimum derivative value for every well position but I can't figure out how to write a formula or script that will give the the corresponding temperatures. I'm new to JMP and have very little experience with scripting, can anyone help?
Re: New to JMP and trying to generate a table that will report specific values from a larger data taWow, that works perfectly. Thanks for breaking it down like that!Re: New to JMP and trying to generate a table that will report specific values from a larger data taYour script works great, thank you so much!Re: New to JMP and trying to generate a table that will report specific values from a larger data taHere is how I would do what you specified.
1. Create a new column in your original data table and call it "Minimum Derivative". Set the formula for that column as
Col Minimum( :Derivative, :Well Position )
2. Create a second column called "Temperature at Min Derivative". Set the formula for this column to:
dt = Current Data Table();
currentPosition = :Well Position;
:Temperature[Min( dt << get rows where( :Minimum Derivative == :Derivative & :Well Position == currentPosition ) )];
3. Now, create a summary data table using
Tables==>Summary
set the Group value to the Well Position column, and set the Statistics column to the two new columns, specifying the Mean as the statistic
Re: New to JMP and trying to generate a table that will report specific values from a larger data taThis is not the most elegant script, but it should do the job. Run it with your data table open.
dt = Current Data Table();
//Get Summary Table with Min Derivative by Well Position
dt_summary = dt << Summary(
Group( :Well Position ),
Min( :Derivative )
);
//Add a new column for temperature at Min Deriv
dt_summary << New Column("Temperature at Min Derivative");
for(i = 1, i <= N Row(dt_summary), i++,
well_pos = dt_summary:Well Position[i]; //get current well position
min_deriv = dt_summary:Name("Min(Derivative)")[i]; //get minimum derivative for current well position
min_row = dt << Get Rows Where(:Well Position == well_pos & :Derivative == min_deriv); //find the row in original data table with matching well position and derivative
dt_summary:Temperature at Min Derivative[i] = dt:Temperature[min_row]; //set the value for the new col in the summary table to the temperature in the corresponding row of the original table
);