- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
How to get exact cumulative Prob at specified value in CDF Plot?
For attached example, how to get the exact cumulative Prob at specified value(500) in CDF Plot?
Thanks!
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to get exact cumulative Prob at specified value in CDF Plot?
4 REPLIES 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to get exact cumulative Prob at specified value in CDF Plot?
One option is to use Crosshair toolbar tool
-Jarmo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to get exact cumulative Prob at specified value in CDF Plot?
You can also script it and get an approximate value
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");
dist = dt << Distribution(Column(:NPN1), CDF Plot(1));
fb = Report(dist)["CDF Plot",FrameBox(1)];
ls = fb << Find Seg(LinesSeg(1));
m = ls << get lines;
xval = 115;
idx = Loc Min(m[0, 1] - xval < 0) - 1;
val = m[idx, 2];
show(val);
// Report(dist)["CDF Plot",AxisBox(1)] << Add Ref Line(val);
// Report(dist)["CDF Plot",AxisBox(2)] << Add Ref Line(xval);
You might want to refine the logic how the specific value is calculated from the m matrix
-Jarmo
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to get exact cumulative Prob at specified value in CDF Plot?
Created:
Jul 29, 2024 10:09 AM
| Last Modified: Jul 29, 2024 7:10 AM
(1019 views)
| Posted in reply to message from jthi 07-29-2024
wow, that's powerful!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to get exact cumulative Prob at specified value in CDF Plot?
This goes much off the topic but I tried to do something similar for Graph Builder which uses LineSeg instead of LinesSeg. Due to the smoothing it gets much more difficult and it is time for me to give up (at least for now). Attached is the script and I left some of my "working notes" as commented out code and the code isn't optimized at all.
View more...
/*""" Attempt to get y-value from Graph Builder LineSeg
Author: jthi
Creation Date: 2024-07-30
Creation JMP Version: JMP Pro 18.0.0
Description:
Original post which gave me this idea (LinesSeg)
https://community.jmp.com/t5/Discussions/How-to-get-exact-cumulative-Prob-at-specified-value-in-CDF-Plot/m-p/777203
"""*/
Names Default To Here(1);
// https://community.jmp.com/t5/JMPer-Cable/Understanding-cubic-splines/ba-p/39511 can be interesting read
dt = Open("$SAMPLE_DATA/Semiconductor Capability.jmp");
slider_x = 200;
nw = New Window("Test",
V List Box(align("center"),
V List Box(
Text Box("Adjust to change X"),
Slider Box(110, 530, slider_x, nw << update window, << Set Width(1000));
),
Text Box("Change graph builder smoother settings to see changes to see different fits"),
gb = dt << Graph Builder(
Size(1000, 600),
Show Control Panel(1),
Fit To Window("On"),
Variables(X(:PNP1), Y(:NPN1)),
Elements(Smoother(X, Y, Legend(4)))
);
);
);
fb = Report(gb)[FrameBox(1)];
/*
ls = fb << Find Seg(LineSeg(1));
m_x = ls << Get X Values;
m_y = ls << Get Y Values;
smooth = ls << Get Smoothness;
idx = Loc Sorted(m_x, Matrix(xval))[1];
// {Estimates, Std_Error, Diagnostics} = Linear Regression(m_y[idx::idx+1], m_x[idx::idx+1]);
// yval = Estimates[2] * xval + Estimates[1];
idx = Loc Sorted(m_x, Matrix(xval))[1];
yval = Interpolate(xval, m_x, m_y);
Report(gb)[AxisBox(1)] << Add Ref Line(xval);
Report(gb)[AxisBox(2)] << Add Ref Line(yval);
*/
/*
m_x[2::N Rows(m_x)::2] - m_x[1::N Rows(m_x) - 1::2]
m_y[2::N Rows(m_y)::2] - m_y[1::N Rows(m_y) - 1::2]
sl = Spline Smooth(m_x, m_y, smooth);
*/
Report(gb)[FrameBox(1)] << Add Graphics Script(
ls = fb << Find Seg(LineSeg(1));
m_x = ls << Get X Values;
m_y = ls << Get Y Values;
Marker(Marker State(3), m_x, m_y);
Pen Size(1);
Line(m_x, m_y);
yval = Interpolate(slider_x, m_x, m_y);
Marker Size(5);
Marker(Marker State(12), {slider_x, yval});
V Line(slider_x);
H Line(yval);
Text(Right Justified, Eval List({slider_x, yval + 1}), Eval Insert("(^Round(slider_x, 3)^, ^Round(yval, 3)^)"));
peaks = m_y[1::N Rows(m_y) - 2] < m_y[2::N Rows(m_y) - 1] & m_y[2::N Rows(m_y) - 1] > m_y[3::N Rows(m_y)] |
m_y[1::N Rows(m_y) - 2] > m_y[2::N Rows(m_y) - 1] & m_y[2::N Rows(m_y) - 1] < m_y[3::N Rows(m_y)];
peak_idx = Loc(peaks) + 1;
Marker Size(3);
Fill Color("Red");
Marker(Combine States(Color State("Red"), Marker State(15)), m_x[peak_idx], m_y[peak_idx]);
);
-Jarmo