This website uses Cookies. Click Accept to agree to our website's cookie use as described in our Privacy Policy. Click Preferences to customize your cookie settings.

- JMP User Community
- :
- Discussions
- :
- how to get the x-value which gives me 50% of area under a curve

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

Topic Options

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

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

Created:
Sep 15, 2021 05:29 PM
| Last Modified: Jun 8, 2023 08:38 PM
(501 views)

I have some continuous data and I fit a curve using "Fit Model" and used attributes "Knotted Spline Effect" and 50 knots. Then I save the prediction formula to the table. What I want to do next is to find the fragment size (x-value) which gives me 5%, 10%, 25%, 50%, 75%, 90% and 95% of area. I have 10 samples and so I have 10 very complicated equations.

How do I get the fragment size (x-value) with different area under the curve? I am not familiar with scripts so I prefer learning the mouse clicking way if possible.

1 REPLY 1

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

Created:
Sep 15, 2021 11:51 PM
| Last Modified: Sep 15, 2021 11:52 PM
(484 views)
| Posted in reply to message from dtsang 09-15-2021

I use this example to illustrate one approach. I follow the instructions up to step 7. Then from the red triangle menu of the report, I choose "Save Columns" > "Prediction Formula". Now I get a new column, and the formula is the function of the curve. Copy the formula from the column.

Now go to Scripting Index, and find "Integrate" function.

Now paste the formula and replace the highlighted part, get this:

Now remove all the colon symbols, by replacing colon by empty string.

Also replace "x" by "age", my x variable name.

Now decide where the upper limit of the integration (100%), say 80. And the result is 69.783 for 100%.

Now the task is to find a number to replace 80, and give me 50%: 69.783/2=34.8915. I got 44.228 after maybe a dozen try and error.

It requires JSL programming, but not much, to get more precise result quickly. Mostly still copy and paste. See the following screenshot.

The key is to find the value that minimize the squared difference between integral and the target value 34.8919. So I wrap the difference between integral and the target inside of a square, then call minimize function. Check out the function documentation for the syntax. The result for 50% is 44.226900491921.

- © 2024 JMP Statistical Discovery LLC. All Rights Reserved.
- Terms of Use
- Privacy Statement
- About JMP
- JMP Software
- JMP User Community
- Contact